In short.
This Claude Agent SDK guide helps developers manage large tool catalogs, but its value depends on catalog size and deployment support. It explains how tool definitions are loaded on demand, documents a 10,000-tool catalog limit and a default of up to five results per search, and provides TypeScript and Python configuration examples. The page recommends upfront loading for small catalogs and describes model, hosting and session restrictions. Prices, independent performance measurements and execution results are not supplied.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete page at the exact supplied address, including both code examples, configuration values, model and hosting notices, gateway and HIPAA restrictions, discovery guidance, limits and version notes. The documentation index and all linked pages are excluded. No code, SDK session, MCP connection or tool call was executed; performance, billing and deployment behavior remain unverified.
The overview
identity
The resource is the documentation page “Scale to many tools with tool search” for the Claude Agent SDK [https://code.claude.com/docs/en/agent-sdk/tool-search.md]. It teaches an SDK feature for finding relevant tools without putting every tool definition into the model's context upfront.
It is a technical guide with configuration tables and code examples. The page does not supply a separate installable tool or downloadable package.
assessment
The guide is most useful when a Claude agent has enough tools that their definitions occupy substantial context or make tool selection difficult. It explains both the configuration and the circumstances in which upfront loading may be preferable.
The page estimates that 50 tools can occupy 10,000–20,000 tokens and says selection accuracy declines with more than 30–50 loaded tools. These are documentation claims without a supplied benchmark method or dataset. They do not establish the benefit for a particular agent.
users
The intended readers are developers building Claude Agent SDK applications with remote MCP servers or custom SDK MCP servers. The examples suit developers who already have callable tools exposed through a server.
Beginners can use the explanation to understand why loading fewer definitions leaves more room for conversation and task information. Following the examples requires familiarity with asynchronous TypeScript or Python; SDK installation, credentials and building an MCP server are not taught on this page.
capabilities
The documented feature supports catalogs of up to 10,000 tools and loads up to five relevant tools per search by default. It applies to registered tools from remote and custom SDK MCP servers, as well as built-in tools that support loading on demand.
Developers can use the default behavior, explicitly enable or disable search, or activate it when deferrable definitions reach a chosen percentage of the model's context window. The guide also explains how descriptive tool names and descriptions, plus a short list of available tool categories in the system prompt, can help discovery.
Using it
requirements
The page lists support for Claude Opus 4, Sonnet 4, Haiku 4.5 and later models. Google Cloud's Agent Platform requires the 4.5 generation or later; earlier models on that platform load definitions upfront. Microsoft Foundry deployments hosted on Azure reject tool search, causing the SDK to fall back to upfront loading.
Session settings also matter. CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS disables search, with a managed-settings exception documented for Claude Code v2.1.227 and later. In HIPAA-configured sessions, neither ENABLE_TOOL_SEARCH nor managed settings can enable it. Package installation requirements and exact SDK package versions are not supplied.
mechanism
When search is active, the agent receives a summary of available tools instead of every full definition. When it needs another capability, it searches tool names and descriptions and loads relevant definitions. Those tools remain available until the messages that introduced them are compacted; later use then requires another search.
Each search adds a round trip. In automatic threshold mode, the SDK combines definitions it can defer across servers and eligible built-in tools. Tools marked alwaysLoad and core built-ins such as Bash, Read and Edit load upfront and do not count toward that threshold. Plugin mods can also change whether a tool is deferred.
setup
Configure ENABLE_TOOL_SEARCH through the env option passed to query(). Unset or true enables search where supported. The value auto activates it when deferrable definitions reach 10% of the context window; auto:N sets another percentage, such as auto:5 for 5%. The value false loads all definitions upfront on every turn. Once activated, automatic mode can remain active even if the definitions later fall below its threshold.
In TypeScript, env replaces the subprocess environment, so the example preserves inherited variables with ...process.env. Python merges the supplied env values into the inherited environment. For discovery guidance, the examples append tool categories to the claude_code system-prompt preset using systemPrompt in TypeScript or system_prompt in Python.
example
Both examples register an HTTP MCP server named enterprise-tools at the placeholder address [https://tools.example.com/mcp], set ENABLE_TOOL_SEARCH to auto:5 and ask the agent to find and execute an appropriate database query. A developer must substitute their own server address. The allowedTools or allowed_tools entry mcp__enterprise-tools__* pre-approves every tool from that server.
The examples print the result when a success message arrives. They wrap the single-shot query loop in exception handling because query() raises after yielding an error result; inspecting the result subtype, such as error_during_execution, provides failure information. Neither example was executed, so connectivity, discovery quality and successful database operations remain unverified.
Assessment & evidence
limitations
The documented ceiling is 10,000 tools, and each search returns up to five results by default. Tool names and descriptions influence discovery. The page provides no measured recall, latency distribution or guarantee that the correct tool will be found.
Compaction can require repeat searches. For fewer than roughly ten tools whose definitions fit comfortably in context, the page says upfront loading is typically faster. Model, hosting and session restrictions can force upfront loading regardless of ENABLE_TOOL_SEARCH. Gateway rejection is mentioned, but its troubleshooting instructions are on a linked page outside this evidence.
reasoning
The practical reason to consider this feature is that a large catalog need not occupy the model's context on every turn. Its usefulness depends on whether the reduced definition load outweighs discovery requests and whether tool descriptions make the required capabilities discoverable.
A reasonable inference is that compact, stable catalogs benefit less than large catalogs with varied capabilities. That inference follows the guide's stated tradeoffs; it is not a measured result. The supplied evidence supports configuration decisions but cannot establish performance for a particular application.
alternatives
The directly documented alternative is upfront loading with ENABLE_TOOL_SEARCH=false, which makes all tool definitions available on every turn and avoids discovery round trips. The page recommends considering this approach for small catalogs.
Threshold activation with auto or auto:N provides another configuration choice when developers want search to begin only after definitions occupy a specified share of context. The page links to API documentation for custom implementations, but those implementations and competing products are not assessed here.
evidence
The evidence is the complete documentation page at [https://code.claude.com/docs/en/agent-sdk/tool-search.md], captured on 2026-11-24 at 18:38:13.129 UTC. Its source revision is sha256:53192262923b7b10fe3d4ebcd036e818b6389d51f1e5e491e6febaf5ee31f153.
The page supplies configuration descriptions, platform notices and two code examples. It supplies no execution logs, independent benchmarks or application-specific results. Linked documentation was not included, so claims here are limited to information present on this page.
Access & freshness
costs
The page supplies no prices, per-search charges, model token rates or MCP hosting costs. Total operating cost is unknown.
It describes a tradeoff between sending fewer tool definitions and making an additional request whenever discovery is needed. That suggests a possible token-use benefit for large catalogs, but neither monetary savings nor a break-even point is established.
rights
The page does not state a license or redistribution grant for its prose or code examples. Permission for commercial reuse, modification and redistribution is unknown from this evidence. SDK and service licensing terms are also not established here.
freshness
No publication or last-updated date appears in the supplied text. The capture date identifies the available snapshot; behavior after that capture is unknown.
Version boundaries are material: before Claude Code v2.1.221, Google Cloud's Agent Platform required explicit configuration to enable search; before v2.1.304, gateways configured through ANTHROPIC_BASE_URL also required explicit enabling. These are Claude Code version references. The page does not identify corresponding TypeScript or Python SDK package versions.
actions
Before adopting the configuration, establish whether the intended model, hosting platform and session settings permit tool search. Use specific tool names and descriptions, replace the placeholder server address, preserve the inherited environment in TypeScript, and review the example's wildcard permission because it authorizes every tool from that server.
Compare supported default behavior, an automatic threshold and upfront loading on representative tasks. Measure completed tasks, missed tool discoveries, token use, end-to-end time and actual charges. Include a long conversation that triggers compaction to assess rediscovery. These are suggested evaluations; no such measurements are available in the supplied evidence.
