Skip to content
ChaiBytes

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.

By , Founder

2 min read

Share

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: true on an mcp_server tool 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_search with "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_search adds 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

, Founder

Sources

  1. Introducing Tool Retrieval in the Gemini API — Google AI Blog Official source
  2. 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

Was this helpful?

Questions or something to add?

Ask below. We read every comment and reply when we can.

Leave a comment

Be respectful. Comments with links are reviewed before they appear. Your email is used only to contact you about your comment, such as a reply from the editor.