Tool Retrieval in the Gemini API: loading tool schemas on demand
Google has put Tool Retrieval into preview in the Gemini Interactions API, letting agents keep hundreds of tools on standby and load parameter schemas only when needed. Here is what shipped, why tool-definition bloat matters, and where I would be careful.

Google has put Tool Retrieval into preview in the Gemini API. The short version: an agent can keep a large tool library on standby and load each tool's parameter schema only when the task actually needs it, instead of shipping every schema in every request. It is an API feature in the Interactions API, not a new model, and it is worth understanding because it targets one of the more mundane but real limits on how far a single agent scales.
What shipped
You enable it by adding a tool_search tool to the request and setting defer_loading: true on the tools you want held back. The model still sees the name and description of every deferred tool, so it knows what exists. What stays out of context is the parameter schema, which is usually the bulk of a tool definition.
When the model decides it needs a tool, it asks for it by name, the API loads the full schema, and the model emits the function call, all inside the same request. The announcement shows all three steps (tool_search_call, tool_search_result, function_call) surfacing in interaction.steps, which is useful when you are debugging why a tool was or was not picked. From there it is ordinary function calling: your code executes and returns a function_result.

A few details matter more than the headline:
- Server-side by default. There is no index to build or host; Gemini runs the search. You can still keep your most-used tools loaded up front and defer the long tail.
- Client-side mode. If you already have a tool registry, an embedding index, or per-user permission filtering, you can declare
tool_searchwith"execution": "client"and run the lookup yourself. That costs one extra round trip per search, but tools no longer need to be declared up front, so you can expose a new integration mid-conversation. - MCP servers. Setting
defer_loading: trueon a remotemcp_servertool defers every tool that server exposes, which is exactly where context bloat bites hardest. - Prefix caching. Deferred schemas stay out of the start of the prompt and loaded ones are appended later, so the cached prefix stays stable across turns.
- Pricing and models. No separate charge.
tool_searchadds a small fixed block of input tokens, and each loaded schema is billed as input for the rest of the conversation. It works with Gemini 3.6 and later, including the Gemini 4 models.
Why it matters
In production agents, the tool list grows faster than anyone plans for. Every new integration adds a schema, and every schema is paid for on every turn whether it is used or not. Google names the three costs plainly: more input tokens, more latency, and lower tool-selection accuracy as the candidate list grows. The third is the one I care most about. Token cost is a budget line; selection accuracy is a correctness problem, and it degrades quietly.
Splitting a tool into a cheap discovery layer (name and description) and an expensive execution layer (the schema) is the right factoring. It is the same move we make everywhere else in retrieval: index on a summary, fetch the full document only on a hit.
My take
This is a sensible, incremental feature rather than a new idea. Tool search with deferred loading already exists in other model APIs, and teams running large tool catalogs have been building their own retrieval layers for a while. What Google adds is a managed default, a clean client-side escape hatch, and attention to prefix caching, which is where a naive implementation would quietly lose its savings.
Three cautions before turning it on everywhere:
- Descriptions now carry the load. If the model only sees names and descriptions, a vague description means a tool never gets found. Treat tool descriptions as retrieval keys and test them the way you would test a search index.
- Measure, do not assume. Google says as much: you save tokens only when the schemas you never load outweigh the ones you do. For a small, frequently used toolset, eager loading may still be cheaper and simpler.
- It is a preview. Step formats and behavior can change. I would pilot it on the agents with the longest tool tail and keep the eager path available.
For agents connected to large MCP servers or dozens of internal APIs, this is worth trying now. For everyone else, it is a good prompt to audit how many of the tools in your context window your agent actually calls.