Google is giving developers a new way to make AI agents more efficient when working with large collections of tools. Its newly introduced Tool Retrieval feature for the Gemini API allows models to load tool parameter schemas only when needed, rather than including the complete definitions of every available tool in every request.
The feature is now available in preview through Google’s Interactions API. It addresses a growing challenge for developers building AI agents that rely on dozens or even hundreds of functions, integrations, and external services.
When an agent has access to a large tool library, every API request can carry substantial overhead. Sending the complete parameter schemas repeatedly increases input token consumption, adds latency, and can make it harder for a model to select the right tool from an increasingly large list.
Tool Retrieval is designed to address all three problems by keeping most tool schemas out of the initial context until the model actually needs them.
How Tool Retrieval works
Previously, developers generally had to provide the full definitions of their available functions in API requests. With Tool Retrieval, they can still declare their tools upfront but defer loading their detailed parameter schemas.
To enable the feature, developers add a tool_search tool to their request and set defer_loading: true on functions they want to make available on demand.
The model continues to see the name and description of each deferred tool, allowing it to understand what capabilities are available. However, the complete parameter definitions remain outside its initial context.
When the model determines that it needs a particular function, it requests that tool by name. The Gemini API retrieves its full schema and makes it available to the model, which can then generate the corresponding function call.
Importantly, Google’s server-side implementation handles the search and schema retrieval within the same API request. Developers don’t need to build or maintain a separate search index for this functionality.
Google also provides visibility into the retrieval process through the interaction’s steps. Developers can inspect the tool search request, the retrieved schema, and the resulting function call, making it easier to understand how an agent selected a particular function.
Server-side and client-side retrieval options
Google offers two approaches to Tool Retrieval, depending on how developers manage their tool libraries.
Server-side retrieval is the simpler option. Gemini handles the search and retrieves the required schemas automatically. It is particularly useful for applications with large, relatively stable tool libraries, where reducing additional network round trips is important.
Client-side retrieval provides more control. Developers can connect their own tool registries, embedding indexes, search systems, or permission filters. Instead of having Gemini retrieve schemas directly, the model requests a search through a developer-defined function, and the application returns matching tool definitions.
This approach also allows applications to introduce new tools during an ongoing conversation. For example, an agent can gain access to additional functions when a user connects a new service or integration.
The trade-off is latency. Client-side retrieval requires an additional round trip for each search because the application has to perform the lookup and return the matching schemas.
Google also highlights compatibility with remote Model Context Protocol (MCP) servers. Developers can defer loading an MCP server’s tools, allowing Gemini to retrieve individual capabilities when required instead of loading the entire collection upfront.
Lower token consumption without an additional feature charge
Tool Retrieval does not come with a separate usage fee. Google says input and output tokens continue to be billed at the standard rates for the selected Gemini model.
There is a small fixed input-token overhead for enabling tool_search. Additionally, every schema retrieved by the model is counted as input tokens for the remainder of the conversation, just as it would be if the tool had been included from the beginning.
The potential savings come from avoiding the repeated inclusion of schemas that an agent never actually uses. For applications with extensive tool libraries, the number of schemas left unloaded can significantly outweigh the additional overhead.
Google also says Tool Retrieval works with prefix caching. Because deferred schemas are excluded from the beginning of the prompt and added later when requested, the cached prefix can remain consistent across requests.
That could make the feature particularly useful for agents handling complex workflows, where maintaining a large collection of available functions would otherwise create unnecessary token consumption.
Availability and supported Gemini models
Tool Retrieval is currently in preview and requires the Interactions API using the v1beta API version. It works with Gemini 3.6 and later models, including the Gemini 4 model family.
One important limitation is that Tool Retrieval is currently exclusive to the Interactions API. Google’s existing generateContent method does not support the feature.
Developers can start experimenting with it using the official Tool Retrieval documentation, which includes implementation examples for Python, JavaScript, and REST.
As AI agents become increasingly dependent on external tools and integrations, managing the amount of information models need to process becomes just as important as improving their underlying capabilities. Google’s approach doesn’t change what these agents can do, but it could make building and scaling them considerably more efficient.
Discover more from GadgetBond
Subscribe to get the latest posts sent to your email.
