Google has added the Tool Retrieval mechanism to the Gemini API, designed for AI agents with large function catalogs and connected MCP servers. Full tool schemas do not fit into the context in advance: the model receives them only when it determines that a specific call is necessary.
The feature is available in preview within the Interactions API. It is not yet supported in the classic generateContent.
How deferred loading works
The developer declares a special search tool and adds the defer_loading: true parameter to rarely used functions. Before a search, the model sees the name and short description of each such function, but not its parameters. According to Google's estimate, this takes about 26 tokens per tool.
If a function is suitable for the current task, the model requests its schema by name. The API adds the parameter description to the context, after which the model performs the call. The entire process takes place within a single request.
An entire remote MCP server can also be deferred. Its tools will be loaded as needed, and the schemas that appear will be saved in the history of the current conversation. The initial part of the prompt remains unchanged and can use caching.
Google's calculation: 200 tools require significantly fewer input tokens
Google's documentation provides a theoretical scenario rather than the result of an independent measurement. For an agent with a library of 200 tools, it specifies approximately 23,650 input tokens when using Tool Retrieval, compared with 164,000 when all schemas are passed normally. The difference is approximately 86%, or nearly seven times.
The company does not claim a separate fee for the mechanism: standard pricing for the selected model applies. However, server-side search launches an additional model pass with context, so the savings depend on the number of search operations and the amount of cacheable data.
When the technology is worthwhile
With a small and stable set of functions, deferred loading may prove disadvantageous. In Google's example with 10 tools and a context of 30,000 tokens, total usage would amount to 92,830 tokens instead of 68,000—approximately 36.5% more.
The Gemini 4 Hydrogen pricing was used to illustrate the financial impact: $1.50 per 1 million input tokens. In the scenario with 200 tools, the cost of one conversation is estimated at $0.246 with conventional loading and approximately $0.035 with Tool Retrieval. For 10,000 conversations, the difference would be about $2,100. Output tokens and cache costs are not included in the calculation; cached Hydrogen input costs $0.075 per 1 million tokens.
Google recommends the traditional approach for libraries of approximately up to 20 stable tools. If you have your own catalog or a complex permissions system, you can use the client-side mode execution: "client". It allows functions to be searched on the application side and new integrations to be added directly during the conversation, but each search requires an additional exchange with the model.
Comparison with Anthropic and OpenAI solutions
In terms of interface, Gemini's implementation is similar to the search tools from Anthropic and OpenAI: they use tool_search, deferred loading, and a choice of how the search is executed. However, the platforms show the model different portions of the catalog before the search begins.
| Parameter | Gemini API | Claude API | OpenAI Responses API |
|---|---|---|---|
| What is available before the search | The name and description of each deferred function | The search tool itself and functions without deferred loading | Function names and descriptions; for namespaces and MCP servers, a general description |
| Search mechanism | Requesting schemas by exact name | Regular expression or BM25, up to 5 results by default | Loading individual functions, namespaces, or MCP servers |
| Supported models | Gemini 3.6 and later, including Gemini 4 Neon | Claude 4.5 and later | GPT-5.4 and later |
| Claimed savings | Not stated separately; approximately 86% in the calculated example | More than 85% | 47% |
Gemini's approach involves a trade-off: even the deferred catalog is partially present in every request. For example, 1,000 functions at 26 tokens each amount to approximately 26,000 input tokens even before a search. In Anthropic's system, deferred tools are not added to the initial context, and the permitted catalog size reaches 10,000 tools per request.
The percentages cannot be compared directly: the companies used different conditions and methodologies. Google also did not publish its own tool-selection accuracy figures. Anthropic reported that, on internal tasks with MCP, Claude Opus 4.5's accuracy increased from 79.5% to 88.1% when using Tool Search.
Limitations of the current version
- The feature is in preview, so the API may change before general release.
- A loaded schema cannot be removed before the conversation ends.
- Additional search passes may increase costs with a small catalog.
- There is no separate charge for server-side search, but processed tokens are billed at the model's standard rate.
Thus, Tool Retrieval is primarily intended for agents with dozens or hundreds of tools. With large libraries, it can significantly reduce the size of the initial context, but for small sets of functions, passing schemas normally may remain more efficient.