Tools

Gemini API adds Tool Retrieval to load tool schemas on demand

Google put Tool Retrieval in preview in the Gemini Interactions API, so agents load tool parameter schemas only when a task needs them.

Published Updated

Grayscale card catalog cabinet with one drawer open and one red index card
AI-generated image

TL;DR

  • Tool Retrieval is in preview in the Gemini Interactions API; you add a tool_search tool and set defer_loading: true on tools to hold back [1].
  • There is no separate charge; loaded schemas are billed as normal input tokens [1].
  • It works with Gemini 3.6 and later models, including all Gemini 4 models, and with remote MCP servers [1].

Google launched Tool Retrieval in the Gemini API on 19 November 2026, in preview in the Interactions API [1]. The feature lets an agent keep a large tool library on standby and load each tool’s parameter schema only when the current task needs it [1].

Why it matters

When an agent connected to dozens or hundreds of tools sends every full parameter schema with every request, Google says this raises input token counts, adds latency and makes tool selection less accurate as the list grows [1]. For teams building customer-service or internal agents with many functions, deferring rarely used tools can cut the size of each prompt, though Google advises measuring the savings on your own traffic [1].

How it works

Developers add a tool_search tool to the request and set defer_loading: true on the tools they want to hold back [1]. The model still sees the name and description of every deferred tool, but not its parameter schema [1]. When it needs a tool, it asks for it by name, the API loads the schema, and the model calls the function, all within one request [1]. Each step appears in interaction.steps, which helps when debugging tool names or descriptions [1].

Google runs the search on its servers, so there is no index to build or host [1]. Frequently used tools can stay loaded up front while the long tail is deferred [1]. Because deferred schemas stay out of the start of the prompt, the cached prefix stays the same between turns, which works with prefix caching [1].

Setting defer_loading: true on an mcp_server tool makes every tool from that remote MCP server load on demand [1]. Teams that already have their own tool registry, embedding index or per-user permission filter can declare tool_search with "execution": "client" and run the lookup themselves [1]. This adds one round trip per search, but tools do not have to be declared up front, so new tools can be exposed mid-conversation [1].

Pricing and limits

Tool Retrieval has no separate charge, and tokens are billed at the standard rates of the model called [1]. Turning on tool_search adds a small fixed block of input tokens, and every schema the model loads is billed as input for the rest of the conversation [1]. Google says you save tokens when the schema tokens that are never loaded outweigh those that are, and advises measuring this on your own traffic [1]. The feature works with Gemini 3.6 and later models, including all Gemini 4 models, in the Interactions API [1].

Sources

Written and checked by AI from the sources below

  1. Introducing Tool Retrieval in the Gemini APIGoogle ·

Fact-checked by gpt-6.1-sol on · Editorial policy