Google Introduces Tool Retrieval in Gemini API to Reduce Token Usage
Google has announced Tool Retrieval in preview for the Gemini API to help developers manage large tool libraries more efficiently.
2 min read
What Happened
Google has announced that Tool Retrieval is now in preview within the Gemini Interactions API [1]. This feature is designed to help AI agents manage large collections of software tools more efficiently by loading parameter schemas only when they are needed for a specific task [1].
In standard API requests, sending a full library of tool parameter schemas in every prompt can increase input token counts, add latency, and lower the accuracy of tool selection as the list of candidates grows [1]. With Tool Retrieval, an agent keeps a full library on standby. The model can see the name and description of every deferred tool so it knows what is available, but the detailed parameter schemas stay out of the context until the model specifically asks for them [1].
To use this feature, developers must add a tool_search tool to their request and set defer_loading to true for the specific tools they want to hold back [1]. When the model decides it needs a tool, it asks for it by name, the API loads the full schema, and the model calls the function within the same request [1]. This process appears in interaction.steps, allowing for easier debugging of tool names and descriptions [1].
Key technical details include:
- Tool Retrieval works with Gemini 3.6 and later models, including all Gemini 4 models, in the Interactions API [1].
- It works with remote MCP servers in the Gemini API; setting
defer_loading: trueon anmcp_servertool allows all tools from that server to be loaded on demand [1]. - For those maintaining their own tool registry or embedding index, developers can declare
tool_searchwith"execution": "client"[1]. - There is no separate charge for Tool Retrieval; input and output tokens are billed at the standard rates for the model used [1]. However, turning on
tool_searchadds a small, fixed block of input tokens, and each loaded schema is billed as input for the rest of the conversation [1].
Who Is Affected
This update is intended for developers building applications with the Gemini API, particularly those whose agents connect to dozens or hundreds of tools [1]. Users of Gemini 3.5 Flash-Lite through the Interactions API may also be interested in how token accounting works, as developers have sought clarification on whether total_tool_use_tokens are included in total_input_tokens or total_tokens [2].
About the author
Ali Raza, Founder
Sources
- Introducing Tool Retrieval in the Gemini API — Google AI Blog Official source
- Gemini 3.5 Flash-Lite – Billing of total_tool_use_tokens in Interactions API - Gemini API - Google AI Developers Forum — Google AI for Developers
Drafted with AI assistance from the reports above and checked automatically for sourcing. Always confirm dates, fees and requirements on the official website before acting. Report an error · How we correct mistakes
Questions or something to add?
Ask below. We read every comment and reply when we can.