Every tool search in Gemini costs another full model pass: as many input tokens as the request's prompt, minus whatever is cached. That is the detail that matters most in Tool Retrieval, the feature Google launched on November 19, 2026 to let an agent keep hundreds of tools on hand without stuffing every schema into the context. Anthropic offers the same thing in the Claude API as a stable feature, and putting the two side by side shows what to measure before you switch it on.
What it is and what it brings
The problem is familiar to anyone who has wired several MCP servers into an agent: tool definitions eat the context before the model does any work, and picking the right tool gets harder the more of them it sees. Tool Retrieval tackles this with deferred loading:
- You add a
tool_searchtool and mark the tools you want to hold back withdefer_loading. - The model sees each deferred tool's name and description (about 26 tokens per tool in Google's early testing), but not its parameter schema.
- When it needs one, it asks for it by name, the API loads the full schema and the model emits the call, all within the same request.
- Setting
defer_loadingon anmcp_serverentry defers every tool that remote MCP server exposes. - A client mode (
"execution": "client") lets you run the search yourself against your own registry or an embedding index, at the cost of an extra round trip.
Schemas are appended where they are loaded rather than at the start of the prompt, so implicit caching keeps working across turns.
How to try it
It's in preview, only on the Interactions API (not generateContent), and needs the v1beta API version. Supported models are gemini-4-hydrogen, gemini-4-argon, gemini-3.8-flash and gemini-3.6-flash; on any other model, defer_loading returns a 400. This is the example from the docs, with one of your own functions and an MCP server, both deferred:
from google import genai
client = genai.Client(http_options={"api_version": "v1beta"})
tools = [
{"type": "tool_search"},
{
"type": "function",
"name": "convert_currency",
"description": "Convert an amount from one currency to another.",
"defer_loading": True,
"parameters": {
"type": "object",
"properties": {
"amount": {"type": "number"},
"to": {"type": "string"},
},
"required": ["amount", "to"],
},
},
{
"type": "mcp_server",
"name": "weather_service",
"url": "https://gemini-api-demos.uc.r.appspot.com/mcp",
"defer_loading": True,
},
]
interaction = client.interactions.create(
model="gemini-4-hydrogen",
input="Check the temperature in London and convert 100 USD to EUR.",
tools=tools,
)
for step in interaction.steps:
print(step.type, getattr(step, "name", ""))The response contains tool_search_call and tool_search_result steps and, for your own functions, a function_call that you run and answer with a function_result. If you work statelessly (store=false), you must send the search steps back unchanged, signature included, or the API returns a 400.
How it stacks up against Claude's tool search
| Gemini Tool Retrieval | Claude tool search | |
|---|---|---|
| Status | Preview, v1beta, Interactions API only | Stable on the Claude API, Bedrock, Google Cloud and Foundry |
| How it searches | Another model pass on the server | Regex or BM25 on the server, no extra pass |
| Cost of a search | ~ the prompt's input tokens, minus cache | Not billed separately |
| Deferred tools in context | Name and description (~26 tokens each) | None until found |
| Deferred tool limit | Not documented | 10,000 per request |
| Bring your own search | Client mode, can't mix with server mode | Custom tool returning tool_reference |
| MCP | defer_loading on mcp_server | defer_loading in the mcp_toolset default_config |
In both cases a loaded schema is billed as input for the rest of the conversation, and neither lets you unload it.
Where it wins and where it loses
Gemini wins on potential search quality: the model sees the whole catalog (names and descriptions) and decides with the full context of the task, instead of relying on a regex or a BM25 query matching the words in a description. For catalogs with vague names or near-duplicate tools, that is a real advantage.
It loses on cost and predictability. Every search is another model pass over the whole prompt; in a long conversation with little cache, a few searches in one turn can cost more than sending the schemas up front. Google concedes as much by telling you to measure it against your own traffic, and its docs suggest server mode for fewer than about 20 stable tools or for large fixed libraries. And even when a schema stays unloaded, every deferred tool still takes up its line in the context, so the savings shrink with thousands of tools.
Claude, by contrast, keeps deferred tools out of the context entirely and searches with regex or BM25 at no extra model cost. Anthropic puts the definitions for five typical servers (GitHub, Slack, Sentry, Grafana and Splunk) at around 55,000 tokens and the usual reduction with search at more than 85%. The trade-off is that hit rate depends on good descriptions and consistently prefixed names (github_, slack_).
Verdict
If you already build on Gemini 4 with the Interactions API and your agents juggle dozens of tools across several MCP servers, Tool Retrieval is worth a test, tracking total_tool_use_tokens before and after: that is where the cost of each search shows up. If your agent always uses the same five or six tools, leave them undeferred and don't enable anything. And if this alone is deciding your provider, as of November 20, 2026 Claude's tool search is the more mature and cheaper one to run; Gemini's is the more promising one for messy catalogs.