Tool search tool
A tool search tool lets a model find and load tool definitions on demand instead of all up front. How Anthropic, OpenAI and Google's Gemini API each do it.
A tool search tool is a built-in tool the model calls to look up other tools, so that only the definitions it needs are loaded into context. Anthropic describes its version as letting Claude work with hundreds or thousands of tools by searching a catalog instead of loading every definition up front. OpenAI offers a tool search feature, and Google added a preview called tool retrieval to the Gemini API in November 2026. All three work with function calling and with MCP servers.
Why it exists
Anthropic gives two reasons. The first is context bloat: a multiserver setup with GitHub, Slack, Sentry, Grafana and Splunk can use about 55k tokens on definitions before any work starts, and tool search typically cuts that by over 85 percent. The second is selection accuracy, which Anthropic says degrades once a model has more than 30 to 50 tools to pick from. This is context engineering applied to tool definitions: load them just in time.
How the server-side flow works
The three vendors share a shape. You declare every tool, mark most of them as deferred, and add a search tool. The model sees the search tool plus the non-deferred tools, searches when it needs more, and the API loads the matching definitions into the conversation.
Anthropic lists the steps: you set defer_loading: true on tools that should not load up front, at least one tool must stay non-deferred, and a search returns tool_reference blocks that the API expands into full definitions. OpenAI says to add {"type": "tool_search"} to tools and mark functions with defer_loading: true. Google uses the same two pieces for server-side retrieval.
Deferring does not shrink the request body. Anthropic states you still send every tool’s full definition on every request, and Google says the API does not persist tool declarations across turns. What shrinks is what the model reads and what you pay for as input tokens.
Client-side search
You can run the lookup yourself when built-in search is not enough, for example with embeddings or a per-user permission filter. Anthropic supports this by letting a custom tool return tool_reference blocks. OpenAI calls it client-executed search: the model emits a tool_search_call, stops, and your app returns a tool_search_output. Google describes a tool_search declared with execution: "client", where your app returns matching declarations in function_result.result.
OpenAI recommends hosted search when candidate tools are known at request time and client search when discovery depends on project, tenant or external state. It also warns that client mode can return tools that were not in the original request, so validate those schemas and expose only trusted definitions. Google says client-side search adds one round trip per search, which server-side search does not.
Side by side
As of November 2026, from the docs of Anthropic, OpenAI and Google, with Google’s model list from its changelog:
| Criterion | Anthropic | OpenAI | Google (Gemini API) |
|---|---|---|---|
| Name | Tool search tool | Tool search | Tool retrieval |
| Status | Stable | Documented in the Responses and Agents APIs | Preview, v1beta, Interactions API only |
| Server-side search | Yes, regex or BM25 variants | Yes, hosted mode | Yes, the default |
| Client-side search | Yes, a custom tool returns tool_reference blocks |
Yes, execution: "client" |
Yes, execution: "client" |
| What gets deferred | Tools, or whole MCP toolsets | Functions, namespaces and MCP servers | function and mcp_server tools |
| What the model sees before searching | Only the search tool and non-deferred tools | Deferred functions outside a namespace or server still show name and description | Name and description of each deferred tool |
| Documented size or limit | Up to 10,000 deferred tools per request, 5 results by default | Fewer than 10 functions per namespace advised | One tool_search per request, no mixing server and client modes |
| Prompt caching | Deferred tools stay out of the prompt prefix | Loaded tools go at the end; changing the loaded set breaks the cache from that point | Schemas appended inline, so implicit caching still applies once the prefix is big enough |
| Extra charge | None; loaded definitions count as input tokens | No pricing given on the page | None; each server-side search adds a model call |
| Model support | Claude Haiku 4.5, Sonnet 4.5 (deprecated), Opus 4.5 and later; not Opus 4.1 or earlier | gpt-5.4 and later in the Responses API |
Gemini 3.6 and later, including all Gemini 4 models |
Anthropic’s two variants differ in how Claude queries. The regex variant uses Python re.search patterns up to 200 characters, and the BM25 variant uses natural language queries up to 500 characters. Both match tool names, descriptions, argument names and argument descriptions.
Naming “dynamic tool retrieval”
Some news coverage called Google’s feature Dynamic Tool Retrieval. Google’s own changelog and guide call it tool retrieval, and say it is a preview in the Interactions API. The generateContent method does not support it.
When to use it
Anthropic advises tool search when you have 10 or more tools, definitions above 10k tokens, falling selection accuracy, or several MCP servers adding up to 200 or more tools. It advises plain tool calling for fewer than 10 tools, tools that are all used on every request, or definitions under 100 tokens in total. Google suggests server-side retrieval for fewer than 20 stable tools or large, known libraries and MCP servers, and client-side for dynamic registries, namespaces or per-user tools. It also notes that static loading can cost less with small libraries or long contexts that search on every turn.
Writing tools that search well
Search quality depends on the text it matches. Anthropic recommends clear names and descriptions, consistent prefixes by service such as github_ or slack_, keywords that match how users describe tasks, and keeping the 3 to 5 most used tools non-deferred. OpenAI recommends namespaces over loose functions, with clear, high-level namespace descriptions and detail in the function descriptions.
What still needs watching
Loaded tools can pile up again. Google says loaded tools stay in context for the rest of the conversation and cannot be unloaded, and that the model may issue several searches in one turn. Anthropic notes that a search matching nothing returns an empty result rather than an error, and OpenAI says changing the loaded tool set breaks the cache from that point. Anthropic suggests monitoring which tools the model discovers to refine descriptions. To do that you need the search calls recorded in your traces, alongside the tool calls that follow them.
FAQ
What is a tool search tool?
It is a tool the model calls to look up other tools. Anthropic describes it as letting Claude search your tool catalog and load only the tools it needs, instead of putting every definition in the context window.
Do I still send every tool definition with each request?
Yes for the server-side versions. Anthropic says you send every definition on every request, and Google says the same. Deferral controls what enters the model's context, not what goes over the wire.
When is tool search not worth it?
With a small tool set. Anthropic recommends standard tool calling for fewer than 10 tools, and Google notes static loading can cost less with small libraries.
Does tool search work with MCP servers?
Yes on all three. Each vendor lets you defer a whole MCP server: Anthropic through the MCP toolset default config, OpenAI by setting defer_loading on the server tool, and Google on an mcp_server entry.
Is Gemini's tool retrieval generally available?
Not yet. Google labels it Preview, available only in the Interactions API on v1beta, and warns the API surface may change before general availability.