Gemini API Tool Retrieval: Manage Large Tool Libraries
Google launches Tool Retrieval in preview for Gemini API, letting agents load tool schemas on demand to reduce input tokens and latency.

Google has launched Tool Retrieval in preview for the Gemini API, addressing a practical problem that agents face when they need access to large tool libraries. The feature lets developers load tool parameter schemas on demand instead of sending every tool definition with every request. This approach reduces input token consumption and latency while keeping tool selection accurate as agents scale.
What changed
Google announced Tool Retrieval as a new capability in the Gemini Interactions API. The feature works by keeping a full tool library on standby and loading specific parameter schemas only when an agent actually needs them. Developers enable this by adding a tool_search tool to their request and setting defer_loading to true on the tools they want to defer.
When an agent operates with dozens or even hundreds of tools, sending every full parameter schema on every request inflates input token counts, adds latency, and lowers tool-selection accuracy. Tool Retrieval addresses this by allowing the model to see the name and description of every deferred tool, so it knows what is available, but keeping parameter schemas out of context until they are needed.
The mechanism works within a single API call. When the model needs a tool, it asks for it by name, the API loads the full schema, and the model calls the function. This happens transparently inside interaction.steps, making it easy to inspect which tools the model considered when debugging tool names or descriptions. The visible output includes tool_search_call, tool_search_result, and function_call steps.
Tool Retrieval supports two modes. In server-side retrieval, Google runs the search on its servers, requiring only new tool and flag changes to existing code. In client-side retrieval, developers can declare the tool_search with execution set to client and define their own search parameters. Client-side retrieval adds one round trip per search but allows for custom tool registries, embedding indexes, or per-user permission filters. The feature also works with remote Model Context Protocol (MCP) servers, letting developers connect a large server without listing its tools one by one.
Tool Retrieval is compatible with prefix caching. Deferred schemas stay out of the start of the prompt, and schemas the model loads are added later in the conversation, so the cached prefix stays the same from turn to turn.
Why it matters
This feature matters to developers building AI agents that need access to large tool libraries. As costs of token usage become more central to AI application economics, reducing unnecessary token consumption directly improves deployment efficiency and cost. The capability also improves tool-selection accuracy by preventing the candidate list from becoming too large.
Teams managing complex agent workflows benefit from the flexibility to keep frequently used tools ready while deferring the long tail. Developers who maintain their own tool registries or permission systems can implement client-side retrieval to expose new tools mid-conversation when users connect integrations, without declaring every tool upfront.
Tool Retrieval has no separate charge. Input and output tokens are billed at standard rates for the model being called. Adding tool_search incurs a small, fixed block of input tokens, and each schema the model loads is billed as input for the rest of the conversation. Developers save tokens when the schemas they never load outweigh the ones they do, which is typical for large libraries.
The feature works with Gemini 3.6 and later models, including all Gemini 4 models, in the Interactions API. This broad compatibility means existing codebases can adopt it without major refactoring.
What to test
Before adopting Tool Retrieval in production, verify these claims against your own traffic patterns:
-
Measure actual token savings for your tool library. You save tokens when deferred schemas outweigh loaded ones, which depends on your specific usage. Monitor both the small fixed token cost of tool_search itself and the cumulative cost of schemas the model actually loads.
-
Test tool-selection accuracy with your full library. The feature aims to improve accuracy as the candidate list grows. Run benchmarks against your agent’s typical requests to confirm.
-
Validate latency improvements. Server-side retrieval runs searches on Google’s servers, while client-side retrieval adds one round trip per search. Time both modes with your typical workload to understand the trade-offs.
-
Confirm compatibility with your MCP servers or custom tool registries. If you use remote servers or client-side retrieval, test that defer_loading works as expected and that your permission filters or registry search logic integrates cleanly.
-
Check interaction.steps output for debugging. Verify that visibility into tool_search_call, tool_search_result, and function_call steps matches your logging and observability needs.
Common questions
Can Gemini do RAG with Tool Retrieval?
Tool Retrieval is not the same as Retrieval Augmented Generation. Tool Retrieval manages access to tool schemas on demand, while RAG typically refers to indexing and searching over documents or data. The Gemini API has separate features for both.
How do I access the Gemini API with Tool Retrieval?
Tool Retrieval is available in preview in the Gemini Interactions API. Developers can start using it by adding a tool_search tool and setting defer_loading to true in their requests. The feature requires Gemini 3.6 or later models.
What models support Tool Retrieval?
Tool Retrieval works with Gemini 3.6 and later models, including all Gemini 4 models.
The conclusion
Tool Retrieval is a practical engineering feature for managing large tool libraries in agent applications. It trades a small fixed token cost and occasional lookup latency for significant savings when you have many tools but use only a subset in most requests. The lack of a separate charge and compatibility with existing models make adoption low-risk.
The real value depends on your use case. If your agent connects to dozens of tools but uses only three or four in most conversations, the savings are likely substantial. If your agent uses most tools regularly, the benefit diminishes. Server-side retrieval requires minimal code changes, while client-side retrieval offers flexibility for custom registries and mid-conversation integration exposure.
The decision to measure token savings against your own traffic is critical, since the benefit varies widely based on usage patterns. For teams managing complex agent deployments with large tool libraries, Tool Retrieval provides a straightforward path to reduce costs and improve accuracy without major architectural changes.
Related reading
AI Tool Herald may earn a commission from some links on this site. It never changes what we report or recommend. Affiliate disclosure
Related stories

Claude Ship: automate GitHub code review and approvals
Anthropic launches Claude Ship to automate code review, fixes, and approvals for GitHub pull requests. Two new agents in beta eliminate approval bottlenecks in...
Perplexity Monitor API: scheduled web tracking for agents
Perplexity's Monitor API webhook service schedules recurring web searches and page monitoring, filtering results by relevance and sending updates to AI agents.

Perplexity Orchestrator API: 85+ models, unified billing
Perplexity Orchestrator API routes requests to OpenAI, Anthropic, Google, xAI and open models through one endpoint with automatic failover and unified billing.
