Tool Retrieval preview in Gemini Interactions API lets developers defer tool schemas until needed, cutting token costs and latency while scaling large tool libraries.
Tool Retrieval has arrived as a preview feature in the Gemini Interactions API, offering a new way for developers to handle large libraries of callable tools without paying the token and latency tax of sending every tool’s full parameter schema on every request.
As agents become more capable, they also tend to accumulate integrations—dozens or even hundreds of functions for tasks like refunds, scheduling, data lookups, or workflow automation. Until now, providing the model with the complete schema for each tool in every prompt could quickly balloon input token counts. That adds cost, increases response time, and can make tool selection less reliable as the list of candidates grows.
The new approach is simple: keep your full catalog available, but only load the detailed parameter schema when the model actually needs to call a specific tool. With Tool Retrieval enabled, Gemini continues to see every deferred tool’s name and description—enough to understand what capabilities exist—while the schema details remain out of context until requested. When the model decides it needs a tool, it requests that tool by name, the API pulls in the schema, and the model proceeds to produce the function call, all within a single request cycle.
Developers can try Tool Retrieval today by adding a tool_search tool to their Interactions API request and setting defer_loading: true on the tools they want to hold back. The sequence is visible in interaction.steps, where you can inspect how the model searched for and selected a tool (for example, locating something like issue_refund), then watch the API load its schema and the model emit the resulting function_call. After that, it’s the standard function-calling pattern: your application executes the tool and returns a function_result.
Google notes that there’s no separate index to build or host when using server-side search. Gemini performs retrieval on the backend, meaning most applications only need the additional tool_search declaration plus the deferral flag. Teams can also choose a hybrid strategy—keeping their most frequently used tools fully loaded while deferring the “long tail” that rarely gets called.
Tool Retrieval is also designed to work well with prefix caching. Because deferred schemas are not included at the start of the prompt, the cached prefix can remain stable across turns, while any schemas that do get loaded are appended later in the conversation.
The feature extends to remote MCP servers in the Gemini API as well. By setting defer_loading: true on an mcp_server tool, the tools exposed by that server can be fetched on demand—allowing developers to connect to a large server without enumerating every tool ahead of time.
For teams that maintain their own registries, embedding-based search, or per-user permission filtering, Tool Retrieval can also run client-side. Setting tool_search with "execution": "client" lets an app perform the lookup itself using custom search parameters. This adds an extra round trip per search, but it also means tools don’t have to be declared upfront—enabling new tools to appear mid-conversation when a user connects an integration.
Pricing follows standard model billing. Tool Retrieval carries no separate fee: input and output tokens are billed normally. Enabling tool_search adds a small, fixed input token block, and any retrieved schema is billed as input for the rest of the conversation just as if it had been provided from the start. The savings come when many schemas are never loaded—a common pattern in large tool libraries—so developers are encouraged to measure against their own traffic.
Tool Retrieval works with Gemini 3.6 and later, including all Gemini 4 models, through the Interactions API.
Why it matters
As AI agents expand from a handful of functions to sprawling integration catalogs, tool schema overhead can become a real performance and cost bottleneck. Tool Retrieval shifts that burden from “always send everything” to “load only what’s needed,” which could make large-scale agent deployments faster and cheaper. The key thing to watch next is how well retrieval holds up in production as tool libraries grow and as developers balance server-side convenience with client-side control and permissions.
