models

Google's Gemini API Gets Tool Retrieval: Smarter, Faster Agent Tools

Summarized by AI from reporting by Google AI Blog, published under our editorial policy.

Google has introduced Tool Retrieval in the Gemini API, allowing AI agents to access tools on demand rather than loading them all at once. This reduces costs and speeds up performance, making it easier to manage large tool libraries.

A developer working on a computer, illustrating Google's Tool Retrieval feature in the Gemini API.

Key takeaways

  • Google's Gemini API now includes Tool Retrieval, allowing AI agents to load tool schemas on demand.
  • Tool Retrieval reduces input token counts and latency, making the system faster and more cost-effective.
  • The feature is compatible with Gemini 3.6 and later models, including all Gemini 4 models.
  • Developers can enable Tool Retrieval by adding a tool_search tool and setting defer_loading to true.
  • Tool Retrieval works with remote MCP servers and plays well with prefix caching.

Google has launched Tool Retrieval in the Gemini API, a new feature designed to help AI agents manage large tool libraries more efficiently. Instead of loading every tool's details at once, agents can now pull in the specific tools they need for a task, reducing data usage and improving performance. This update is part of Google's ongoing efforts to enhance the capabilities of its AI models, making them more powerful and cost-effective for developers.

How Tool Retrieval Works

Tool Retrieval allows agents to keep a library of tools on standby and load only the necessary parameter schemas when a task requires them. This approach reduces input token counts and latency, making the system faster and more cost-effective. To enable this feature, developers need to add a tool_search tool to their requests and set defer_loading to true for the tools they want to keep on standby.

The model still sees the names and descriptions of all tools, ensuring it knows what's available, but the detailed parameter schemas are loaded only when needed. This process happens within a single API call, making it seamless and efficient. The feature is compatible with Gemini 3.6 and later models, including all Gemini 4 models, in the Interactions API.

For example, if an agent needs to search for a tool like issue_refund, the API loads its schema, and the model emits the function_call. All three steps appear in interaction.steps, making it easy to inspect which tools the model considered when debugging tool names or descriptions. This ensures that the agent can quickly and accurately access the tools it needs without unnecessary delays.

Why It Matters for Developers

For developers working with AI agents that connect to dozens or even hundreds of tools, Tool Retrieval offers significant advantages. By reducing the number of tokens and the data loaded in each request, the feature speeds up performance and lowers costs. This is particularly useful for complex tasks that require accessing multiple tools.

Tool Retrieval also plays well with prefix caching, ensuring that the cached prefix stays the same from turn to turn. This consistency helps maintain the efficiency of the system. Additionally, the feature works with remote MCP servers, allowing developers to connect large servers without listing their tools one by one. This flexibility is crucial for developers who need to manage extensive tool libraries efficiently.

Practical Steps for Developers

Developers can start using Tool Retrieval immediately by following a few simple steps. First, they need to add a tool_search tool to their requests. Then, they should set defer_loading to true for the tools they want to keep on standby. This setup allows the model to load tool schemas only when they are needed, optimizing performance and reducing costs.

For those maintaining their own tool registry or embedding index, they can declare the tool_search with "execution": "client" and define their search parameters. This client-side retrieval adds one round trip per search, but it allows for more flexibility in managing tools. Developers can also keep their most-used tools loaded up front and defer the long tail, ensuring that the most critical tools are always readily available.

What Developers Can Do Today

Developers can start using Tool Retrieval immediately by visiting the Gemini API documentation and following the setup guide with examples. They can also join the discussion on Discord to share feedback with the Google team and stay updated on the latest developments.

For more information, developers can read the full setup guide, compare Gemini models to find the best fit for their use case, and join the discussion on Discord. They can also sign up for Google's newsletters to receive product updates, event information, and special offers. By leveraging these resources, developers can stay ahead of the curve and make the most of the new Tool Retrieval feature in the Gemini API.

Frequently asked

Is Tool Retrieval available for all Gemini models?
Tool Retrieval works with Gemini 3.6 and later models, including all Gemini 4 models.
How do I enable Tool Retrieval in the Gemini API?
To enable Tool Retrieval, add a tool_search tool to your requests and set defer_loading to true for the tools you want to keep on standby.
Does Tool Retrieval add any additional costs?
Tool Retrieval has no separate charge. Input and output tokens are billed at the standard rates for the model you call.
Can I use Tool Retrieval with remote MCP servers?
Yes, Tool Retrieval works with remote MCP servers in the Gemini API, allowing you to connect large servers without listing their tools one by one.