Omniscio

OmniscioGuidesClaude Code tool search

Claude Code tool search: MCP tools loaded on demand

Every MCP server you add brings its tools with it, and each tool is a description that would otherwise sit in the context window from the first message.

Adding and configuring a server is a different guide; this page covers what happens to its tools once it is connected, and what to do when they refuse to be deferred.

Sources read November 25, 2026. By the Omniscio team. Updated .

What tool search changes

Tool search keeps MCP context usage low by deferring tool definitions until Claude needs them. Only tool names and server instructions load at session start, which is why adding more MCP servers has a minimal effect on the context window.

Claude Code imposes no fixed per-server tool cap. The practical limit is your context window budget, and deferral is what keeps that budget from being spent before the session starts.

When a server finishes connecting while Claude is working, and tool search is on, Claude Code lists the server's tool names to Claude on its next request in the same turn, so Claude can search for and call them without waiting for your next message.

A server that fails to connect is reported differently with tool search on: Claude Code tells Claude which server failed and its connection error, so Claude passes the failure on to you instead of working quietly with fewer tools. The MCP errors guide covers what each failure means.

What ENABLE_TOOL_SEARCH accepts

Tool search is enabled by default: MCP tools are deferred and discovered on demand. ENABLE_TOOL_SEARCH changes that.

  • Unset or true: all MCP tools are deferred and loaded on demand, with fallbacks for older models and unsupported deployments.
  • auto: threshold mode. Tools load upfront while their definitions total under 10% of the context window; at 10% or more, tool search turns on.
  • auto:N: the same threshold with your own percentage, from 0 to 100.
  • false: every MCP tool loads upfront, with no deferral.
ENABLE_TOOL_SEARCH=auto:5 claude

The variable can also go in the env field of a settings file, so every session that reads that file gets the same threshold. Setting it to false is the honest way to compare a session with and without deferral.

When every tool loads upfront anyway

On models earlier than Claude Opus 4, Sonnet 4 and Haiku 4.5, Claude Code loads all MCP tools upfront, and ENABLE_TOOL_SEARCH=true does not override it. On Google Cloud's Agent Platform the same is true of models earlier than Opus 4.5, Sonnet 4.5 and Haiku 4.5.

Microsoft Foundry deployments hosted on Azure reject tool search server-side. Claude Code detects the rejection and loads MCP tools upfront for that deployment, and ENABLE_TOOL_SEARCH cannot override it because the refusal comes from the deployment.

A session under the HIPAA configuration has tool search off, and neither ENABLE_TOOL_SEARCH nor managed settings turns it back on. Setting CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS also keeps tool search off, and that setting cannot be overridden. On v2.1.227 or later an organization can still keep tool search on while that variable is set, through managed settings.

You can also switch it off per session by denying the tool:

{
  "permissions": {
    "deny": ["ToolSearch"]
  }
}

Denying ToolSearch, or leaving it out of --tools, makes MCP tools load upfront.

Behind a gateway

When ANTHROPIC_BASE_URL points at a gateway, Claude Code expects it to forward the defer_loading tool fields and tool_reference blocks along with the beta header. Tool search is on by default there, though before v2.1.304 it was off unless ENABLE_TOOL_SEARCH was true, auto or auto:N.

On v2.1.305 or later, Claude Code retries a request without tool search after a 400 or 422. When the retry works nothing shows on screen and MCP tools simply load upfront; Claude Code tries tool search again later, which can cost one more rejected request.

If you also write the MCP server

With deferral, the server's instructions field matters more: it tells Claude when to search for your tools, the way a skill's description does. Anthropic asks for instructions that say what category of tasks the tools handle, when Claude should search for them, and what the server provides.

Two length limits apply. Server instructions and the description of a tool that loads upfront are cut at 4,096 characters; a description that Claude loads through tool search can run to 16,384. Claude sees only the text before the cut, so put the words Claude would search for near the start.

A server can mark one tool "anthropic/alwaysLoad": true in its _meta so that tool always loads upfront, and the person configuring the server can override that per server. To change both length limits at once, set CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH, which needs v2.1.280 or later.

Reading it in /context

The label tells you which way a session went: a tool marked (deferred) or (loaded on-demand) is waiting to be asked for, and one listed without a label is already loaded. A session that switched tool search on keeps it on even if the definitions later shrink below the auto threshold, for example while servers reconnect after you resume, so a deferred label on a small total is expected rather than a fault.

The context window guide covers the rest of what the command reports.

Sources

Every factual line about the documentation rests on this page of Anthropic's documentation, read November 25, 2026. The CTA at the foot is product copy about Omniscio.

  • Connect Claude Code to tools via MCP, for the Scale with MCP tool search section: deferral, the ENABLE_TOOL_SEARCH values, the models and deployments that load tools upfront, the gateway behaviour, the description limits and alwaysLoad. Read November 25, 2026.

No session was started for this page. Every variable, limit and version floor is transcribed from that page.

Common questions

What is tool search in Claude Code?

Tool search keeps MCP context usage low by deferring tool definitions until Claude needs them. Only tool names and server instructions load at session start, and Claude loads a definition when a task needs it.

Is tool search on by default?

Yes. MCP tools are deferred and discovered on demand unless the model or deployment forces upfront loading, and ENABLE_TOOL_SEARCH changes that behaviour.

How do I turn tool search off?

Set ENABLE_TOOL_SEARCH=false to load every MCP tool upfront, or deny the ToolSearch tool in permissions. Both work, and denying the tool leaves a placeholder in the request that a gateway can reject.

Why do my MCP tools still load upfront?

Four causes: an earlier model than Opus 4, Sonnet 4 and Haiku 4.5, a Microsoft Foundry deployment hosted on Azure that rejects tool search, a session under the HIPAA configuration, or CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS, which keeps tool search off and cannot be overridden by ENABLE_TOOL_SEARCH.

How long can an MCP tool description be with tool search?

A tool description loaded through tool search can run to 16,384 characters, while server instructions and tools loaded upfront are cut at 4,096. CLAUDE_CODE_MAX_MCP_DESCRIPTION_LENGTH sets both to your own number.

More servers, one context

Omniscio runs several agent sessions in one window, and each session can carry its own MCP servers without the others paying for their tools. Any model, any harness: Claude Code, Codex, OpenCode, Devin, Pi, and Hermes all supported.