Introducing Tool Retrieval in the Gemini API

Google has released Tool Retrieval in preview in the Gemini Interactions API, announced on its AI blog by product manager Lucia Loher and research scientist Nora Kassner of Google DeepMind. The feature targets agents that connect to dozens or hundreds of tools: rather than sending every full parameter schema on each request, the agent keeps its tool library on standby and pulls in schemas only when a task calls for them. Google says this lowers input token counts and latency while keeping tool selection accurate as candidate lists grow.
Enabling it takes two changes to a request. Developers add a tool_search tool and set defer_loading to true on the tools they want held back. The model still receives the name and description of every deferred tool, so it knows what exists, but the parameter schemas stay out of context. When the model needs one, it asks for the tool by name, the API loads the full schema, and the model emits the function call, all within the same request. The example in the post defers an issue_refund function alongside more than 50 other deferred functions.
Debugging is built in. Each interaction exposes its steps, including a tool_search_call step listing the requested function names, a tool_search_result step carrying the returned schema, and the eventual function_call with its arguments. Developers can inspect exactly which tools the model considered, which helps when tool names or descriptions are ambiguous. After that, execution follows ordinary function calling: the application runs the tool and returns a function_result.
There is no index to build or host, since Gemini performs the search server-side. That is the key operational difference from rolling your own retrieval layer, which typically means embedding tool descriptions, maintaining a vector store, and re-ranking candidates. Google also notes Tool Retrieval coexists with prefix caching: deferred schemas stay out of the start of the prompt and loaded schemas appear later in the conversation, so the cached prefix remains stable across turns. In practice, that combination is where most of the cost savings would come from, since caching already rewards a fixed prompt prefix and deferral keeps the prefix small.
For teams that already maintain a tool registry, embedding index, or per-user permission filter, there is a client-side option. Declaring tool_search with "execution": "client" lets the application run the lookup itself and define the search parameters, such as a simple query string. Google notes this adds one round trip per search because the app performs the lookup. The trade-off is flexibility: tools do not need to be declared upfront, so an application can surface new tools mid-conversation, for instance when a user connects an integration. That pattern fits permissioned environments where which tools a user may reach depends on account state rather than being fixed at request time.
Tool Retrieval also works with remote MCP servers in the Gemini API. Setting defer_loading: true on an mcp_server tool makes every tool that server exposes loadable on demand, so a large server can be connected without listing its tools individually. That is a practical fit for MCP, where servers often advertise many tools whose schemas would otherwise consume a large share of the context window on every turn.
Pricing is straightforward: there is no separate charge, and input and output tokens are billed at standard rates for the model called. Turning on tool_search adds a small, fixed block of input tokens, and each schema the model loads is billed as input for the rest of the conversation, the same as a tool declared up front. Savings therefore depend on the schemas never loaded outweighing those that are, which Google says is the usual case for large libraries and recommends measuring against real traffic. A likely trade-off is that heavily used tools may still be worth leaving undeferred, and the post's code comment advises keeping frequent tools undeferred.
The feature works with Gemini 3.6 and later models, including all Gemini 4 models, in the Interactions API.
Why it matters: Teams building agents on Gemini can now scale tool libraries without paying to send every schema on every request, and the client-side mode gives organizations with existing registries or permission models a path that keeps control of selection. Because pricing rides on standard token rates with no separate fee, the main work for developers is deciding which tools to defer and measuring the savings, while product teams gain room to expose larger integrations, including MCP servers, without inflating prompt size.
Based on reporting from the original publisher. Visit the source for full context and later updates.
Publisher excerpt
Gemini spark on a space background Give your agents access to hundreds of tools while using fewer tokens with Tool Retrieval, now in preview in the Gemini API.