How Gemini API Tool Retrieval Works and How It Differs from File Search
On 19 Nov 2026 Google launched Tool Retrieval in the Gemini API in preview on the Interactions API. The feature keeps a large tool library on standby and loads full parameter schemas only when the current task needs them—via <code>tool_search</code> and <code>defer_loading: true</code>. This guide separates Tool Retrieval from File Search and Function Calling, then covers setup signals, supported models, and token-based cost rules. Confirm live contracts on Google AI for Developers (Gemini API docs) and Gemini API pricing before you ship.
What Is Tool Retrieval in the Gemini API?
Tool Retrieval solves a scaling problem for agents that expose dozens or hundreds of functions: stuffing every full parameter schema into every prompt inflates input tokens, adds latency, and hurts tool-selection accuracy. Google’s announcement states the model still sees each deferred tool’s name and description, but schemas stay out of context until needed.
<strong>Key facts (as of the 19 Nov 2026 announcement)</strong>:
Not the same as File Search
Tool Retrieval selects and loads <em>function tool definitions</em>. It is not a document RAG indexer. File Search is the separate product that imports files, embeds them, and retrieves snippets for grounding. You can combine both in one agent, but they solve different problems.

How Gemini API Tool Retrieval Works
Enable Tool Retrieval by adding a <code>tool_search</code> tool and setting <code>defer_loading: true</code> on tools you want held back. Inside one Interactions request the model can emit a tool search, receive schemas, then emit a normal <code>function_call</code>—all visible in <code>interaction.steps</code> for debugging.
Illustrative structure based on Google’s announcement (validate model ID and SDK version against live docs before production):
<pre><code>from google import genai client = genai.Client() tools = [ {“type”: “tool_search”}, { “type”: “function”, “name”: “issue_refund”, “description”: “Refund an order”, “defer_loading”: True, “parameters”: { “type”: “object”, “properties”: { “order_id”: {“type”: “string”}, “amount”: {“type”: “number”}, }, “required”: [“order_id”, “amount”], }, }, ] interaction = client.interactions.create( model=”gemini-4-hydrogen”, input=”Refund order A-1042 for $40″, tools=tools, ) print(interaction.steps)</code></pre>
Keep hot-path tools undeferred if you call them on almost every turn; defer the long tail. Tool Retrieval also works with remote MCP servers when <code>defer_loading</code> is set on the MCP tool. Full walkthroughs live on Gemini API docs.
Gemini Tool Retrieval vs File Search
Use this table when designing an agent that needs both live actions and grounded document answers.
How to Set Up Gemini API File Search
File Search remains a separate pipeline: create or select a searchable store, upload allowed files, index them, attach File Search as a tool, then query. Prefer parameter names and limits on File Search documentation and the overview on ai.google.dev Gemini API docs—not third-party paraphrases.
Operational check: if retrieval returns no supporting snippet, treat the turn as a miss and refuse to invent policy text. Log store IDs and matched document IDs before rendering answers.
Combining Tool Retrieval with Function Calling
Architect layers with explicit contracts: Function Calling exposes typed tools; Tool Retrieval decides which deferred schemas enter context; File Search (optional) grounds prose in indexed documents. Overlapping tool descriptions (e.g. search_orders vs find_order) still cause wrong-tool paths—shadow-eval expected tool sequences before go-live.
Prompt policy example: prefer File Search for static policy facts; prefer functions for live account state; answer from conversation only when neither applies. Empty retrieval should yield “insufficient evidence,” not confident guesses.

Supported Models and API Requirements
Per Google’s announcement, Tool Retrieval works with <strong>Gemini 3.6 and later</strong>, including Gemini 4 models, on the <strong>Interactions API</strong>. New projects should prefer Interactions; generateContent remains supported for existing stacks but is not the surface described for Tool Retrieval preview. Confirm availability on Gemini API docs.

Gemini API Pricing and Usage Costs
Tool Retrieval has <strong>no separate product fee</strong>. Input and output tokens bill at the standard rates for the model you call. Enabling <code>tool_search</code> adds a small fixed block of input tokens; each loaded schema is billed as input for the rest of the conversation—same as declaring the tool up front. You save tokens when deferred schemas you never load outweigh the ones you do.
API pricing is <strong>token-metered by model and tier</strong>, not per-seat SaaS. Example snapshot for <strong>Gemini 4 Carbon Standard</strong> as published on ai.google.dev/pricing (verify before budgeting; tiers change): input <strong>$2.00 per 1M tokens</strong>, output <strong>$10.00 per 1M tokens</strong> on the current Standard ladder, with announced Standard changes effective <strong>1 Dec 2026</strong> (input $4 / 1M, output $20 / 1M). Other Gemini models use different rates; Batch/Flex ladders differ from Standard. Carbon is not on the free tier.
Security, Logging and Production Considerations
Scope API keys (or workload identity) separately for staging and production so a leaked staging key cannot read production corpora or invoke live write tools. Log tool_search → schema load → function_call chains from interaction.steps. Cap retries with jitter: tool-heavy turns multiply requests per user action and can hit rate limits before dollar budgets.
Who Should Use Gemini Tool Retrieval?
<strong>Good fit:</strong> agents with large or growing tool libraries, MCP servers with many tools, or prefix-cache sensitive prompts where deferred schemas must stay out of the cached prefix.
<strong>Poor fit (for now):</strong> prototypes with fewer than ~10 tools where full schemas already fit comfortably; stacks that cannot move to the Interactions API yet; workloads that need only document RAG without function tools—use File Search alone instead.
Research Methodology
This article is a research brief synthesized from Google’s Tool Retrieval announcement, Gemini API developer documentation, and published pricing pages as of 20 Nov 2026. It does not claim multi-week production soak tests. Re-verify model IDs, preview status, and dollar figures before shipping.
Verdict
Tool Retrieval is worth adopting when your Interactions-based agent already drowns in tool schemas. Treat it as a preview capability: separate it cleanly from File Search, keep hot tools undeferred, and budget on token meters—not seat licenses. Re-read the official announcement and docs before you lock production model IDs.



