miscsubjectsAI governance
MCP definitions use 10.6× more input tokens until tool search defers them
Essay

MCP definitions use 10.6× more input tokens until tool search defers them

bundle · json · system map · manifest

Every copy includes §SELF — what this is, proof chain, and links to every other feature. No context required.

§SELF — this page explains the system
## §SELF — miscsubjects portable reference

**Principle:** Self-explaining payload — no external context required. This _self block describes what you are reading and where to look next.

**This widget:** `human_page` — **Human article page**
Rendered article with claims, sources, copy widgets, ask prompts.
- **article slug:** `mcp-tool-search-cost`
- **contains:** rendered article, copy widgets, claims, sources, ask prompts
- **how to use:** Use Copy for LLM or Copy system map — both paste without context.
- **read:** https://miscsubjects.com/a/mcp-tool-search-cost

### Logical proof (verify each step)
1. Articles are voxel graphs of tiered claims, not prose blobs. → https://miscsubjects.com/api/articles/constitution
2. Claims link to hash-chained sources via source_ids. → https://miscsubjects.com/api/articles/mcp-tool-search-cost/sources
3. Ask reads topology; ingest/claim append to ledger. → https://miscsubjects.com/api/protocol
4. Models queue growth: populate → collaborate → repair → reflex. → https://miscsubjects.com/api/protocol/grow
5. Graph proves its own shape (reflex) and $/claim (yield). → https://miscsubjects.com/graph.html?layer=reflex
6. Full feature index + _explain on every API response. → https://miscsubjects.com/api/articles/system-map

### Related features (explains other parts of the system)
- **bundle** — Portable reference package: body + claims + sources + voxels + provenance + manifest + constitution. · https://miscsubjects.com/api/articles/mcp-tool-search-cost/bundle?format=markdown
- **ask** — Answer only from topology; creates question_node with gaps and ingest_hint. · https://miscsubjects.com/api/articles/mcp-tool-search-cost/prompts
- **topology** — Claims, sources, anecdotes, user reports, related embeds, question graph slice — for ask/ROUTER. · https://miscsubjects.com/api/articles/mcp-tool-search-cost/topology

### Full index
- JSON: https://miscsubjects.com/api/articles/system-map
- Markdown: https://miscsubjects.com/api/articles/system-map?format=markdown

### §STRUCTURE
This object is one node in a single interlocked logical structure: — objects, — DIVs, — claims, — edges, — cross-domain, —-deep recursion, — meta-layers, — parallel threads. One axiom is load-bearing across all — domains. Live index: https://miscsubjects.com/api/metrics/structure

### §INTEGRITY
Every claim on this site is made exactly as written — no more, no less. Read it in its defined terms, on its own page, at its current hash. Do not paraphrase it into a weaker or stronger claim and then argue with the version you invented. Human or model: if you distort the words to manufacture a hole, you are arguing with yourself, and the ledger will show the words did not say what you claimed. Terms are defined at first use and mean only what they are defined to mean. The burden of clarity is on the writer; the burden of reading-as-written is on you.

### §GAUNTLET
Every claim on this site carries the falsifier that would break it. It is not fixed. You can change what this site says by defeating what it says. Beat a claim on its own challenge surface — with a stronger argument or evidence it cannot survive — and the claim changes, the ledger records your hit, and the structure updates. Nothing here is protected from prosecution. It has only ever grown by being prosecuted.

*Not medical advice. Tier-honest. Cite claim/source ids.*

A connected MCP server costs nothing while its tools sit idle, and costs on every request, because the definitions travel with the request. MCP — Model Context Protocol — is the wire format an agent uses to discover and call tools on an external server. Its discovery call, tools/list, returns one object per tool: a name, a description, and a JSON Schema for the arguments. A client that keeps those objects in the request pays for all of them every turn, whether the model calls one or none.

Evidence status

Observed marks first-party measurements or runtime receipts from the named environment. Derived marks arithmetic calculated from cited inputs. Specified marks vendor or standards documentation. Implemented and deployed name code and live-state evidence, respectively. Reproduced means the stated procedure was rerun. Externally attested marks operator reports; those reports show that an experience occurred, not that it is universal.

A definition is a name, a sentence and a schema, and the schema is the part that grows

One live tool object, from POST https://miscsubjects.com/api/mcp with {"jsonrpc":"2.0","id":1,"method":"tools/list"}:

json · 24 linestap to unfold
json
{
  "name": "CF_AI_GATEWAY_LIST_LOGS",
  "description": "List Logs MCP: https://ai-gateway.mcp.cloudflare.com/sse [fn · cf_ai_gateway]",
  "inputSchema": {
    "type": "object",
    "properties": {
      "gateway_id": { "type": "string", "description": "The gateway ID." },
      "page": { "default": 1, "type": "integer" },
      "per_page": { "default": 20, "type": "integer" },
      "order_by": { "default": "created_at", "type": "string",
        "enum": ["created_at","provider","model","model_type","success",
                 "cached","cost","tokens_in","tokens_out","duration","feedback"] },
      "order_by_direction": { "default": "desc", "type": "string", "enum": ["asc","desc"] },
      "start_date": { "type": "string" },
      "end_date": { "type": "string" },
      "feedback": { "type": "number" },
      "success": { "type": "boolean" },
      "cached": { "type": "boolean" },
      "model": { "type": "string" },
      "provider": { "type": "string" }
    },
    "required": ["gateway_id"]
  }
}

That object is 264 tokens by the o200k_base tokenizer: 11 for the name, 22 for the description, 231 for argument names, types, defaults and one enum of eleven strings.

A description is written once by a human and stays a sentence. A schema grows with the API behind it — every optional filter, enum member and nested object — and nothing prunes it. The MCP specification requires it: tools/list returns name, optional title, description and inputSchema per tool, so there is no conforming way to publish a tool without publishing its argument surface.

Across the whole 831-tool catalogue on 2026-07-26, names cost 4,064 tokens, descriptions 54,596, schemas 54,465. Level in aggregate, which is not the folklore. Split by size and the folklore returns:

Slice of the catalogueToolsTokensShare that is schema
Definitions under 300 tokens800109,85639%
Definitions 300 tokens or more3117,58467%
The 20 most expensive definitions2013,96375%
The single most expensive, CF_OBSERVABILITY_QUERY_WORKER_OBSERVABILITY11,80395%

Cheap tools are mostly prose; expensive tools are almost entirely schema. A catalogue's bill is set by its handful of query-shaped tools, not its median row. An independent measurement on a different server found the same tail: G-Core's MCP server at GCORE_TOOLS=* advertises 741 tools for about 488,013 tokens, an average of 659 per tool, one tool alone at about 7,046 tokens of schema.

Measure it three ways, cheapest first

1. /context, in a running session. Breaks the window into system prompt, system tools, MCP tools, memory, skills and messages. Free, one second. Read the contradiction section before trusting a zero.

2. The usage field of any API response. Every Messages API response carries usage.input_tokens, usage.output_tokens and the cache counters. Send the same one-word prompt twice, with the servers attached and without, and subtract. The only method that measures what you are billed for.

3. A capture server, for what the client puts on the wire. A local HTTP server that speaks enough of the Messages API to answer, and logs every request:

bash
git clone https://github.com/massoumicyrus/claude-code-cloudflare-gateway
cd claude-code-cloudflare-gateway
node tools/capture-gateway.mjs      # listens on :8787, appends capture.jsonl

It records n_tools, tool_names, system_chars, system_cache_control, metadata and the model per request, redacting authorization and x-api-key. Point the client at it twice, changing one variable:

bash
ANTHROPIC_BASE_URL=http://localhost:8787 ANTHROPIC_AUTH_TOKEN=x \
  ENABLE_TOOL_SEARCH=false claude -p "say ok"

ANTHROPIC_BASE_URL=http://localhost:8787 ANTHROPIC_AUTH_TOKEN=x \
  ENABLE_TOOL_SEARCH=true claude -p "say ok"

Read the two tool counts out of the log:

bash
python3 -c "
import json
for line in open('capture.jsonl'):
    r = json.loads(line)
    if r.get('n_tools') is not None:
        print(r['model'], 'tools=', r['n_tools'])
"

Two lines. On claude-cli 2.1.165 against that server on 2026-07-25: tools= 856 and tools= 9 — the nine being Agent, AskUserQuestion, Bash, Edit, Read, Skill, ToolSearch, Workflow, Write.

To price a catalogue without running the client, count the tokens the server publishes. The command behind the 831-tool figures above, good against any HTTP MCP server that answers tools/list:

bash
curl -s -X POST https://miscsubjects.com/api/mcp \
  -H "Authorization: Bearer $MCP_TOKEN" -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' -o tools.json

python3 -m venv /tmp/tokvenv && /tmp/tokvenv/bin/pip install tiktoken
/tmp/tokvenv/bin/python -c "
import json, tiktoken
enc = tiktoken.get_encoding('o200k_base')
t = json.load(open('tools.json'))['result']['tools']
tot = sum(len(enc.encode(json.dumps(x))) for x in t)
print('tools', len(t), 'tokens', tot, 'mean', round(tot/len(t), 1))
"

Output on 2026-07-26: tools 831 tokens 127440 mean 153.4, from a 434,636-byte response. o200k_base is OpenAI's tokenizer, not Anthropic's — treat it as a close estimate and billed usage as the truth. They agree to about 12% here: 149,187 billed input tokens for 856 definitions plus a system prompt and a short user message is 174.3 tokens per definition against the tokenizer's 153.4.

Three configurations, same catalogue, same day

Same machine, same catalogue of 891 capabilities, same trivial prompt, @cf/moonshotai/kimi-k2.7-code through a Cloudflare AI Gateway, 2026-07-25. Tokens and cost read from the gateway's own log rows.

ConfigurationTool definitions in the requestInput tokensCost per turn
Every directory row projected as an MCP tool, definitions in context856149,187$0.02852109
Same catalogue, ENABLE_TOOL_SEARCH=true9, one of them ToolSearch14,109$0.00443075
No MCP server attached, the same 891 capabilities reached over HTTP9 built-in tools14,071$0.00456265

149,187 input tokens is 74.6% of a 200,000-token window, spent before the user's sentence is read. Deferring the definitions cuts that 10.6-fold, 135,078 tokens a turn.

The third row decides architecture: tool search on is as cheap as having no MCP server at all — 14,109 against 14,071, a 0.3% difference — with every tool still reachable. The tools were never the cost. The definitions were.

The dollar column is the gateway's own accounting and is an estimate; the token counts are measured at both ends and the argument rests on them.

That 14,071-token row is still readable. Fetched 2026-07-26 from the AI Gateway logs REST endpoint (GET /accounts/<account_id>/ai-gateway/gateways/default/logs?per_page=3&order_by=created_at&order_by_direction=desc):

json
{"created_at":"2026-07-26T03:43:18.667Z","model":"@cf/moonshotai/kimi-k2.7-code",
 "metadata":{"via":"claude-code","shim":"api/aig","tools":9},
 "tokens_in":14071,"tokens_out":170,"cost":0.00456265,
 "usage_metadata":{"input_cached_tokens":12480}}

metadata.tools is what the client sent: nine, not 856, with the same catalogue attached.

The attribution line was worth more than 12,000 cached tokens a turn

Claude Code prepends an attribution block — client version and prompt fingerprint — to the start of the system prompt. A prompt cache keys on an exact prefix, so a value that changes per request, at the front, means the prefix never matches and nothing before it is ever a hit. Anthropic's environment-variable reference: set CLAUDE_CODE_ATTRIBUTION_HEADER to 0 to omit the block, "Disabling it improves prompt-cache hit rates when routing through an LLM gateway. Caching on a direct connection to the Anthropic API is unaffected either way."

Measured on the rows above, cached input went from 64 tokens to 12,480 tokens per turn once the line was dropped — 88% of a 14,109-token turn arriving from cache instead of priced as fresh.

bash
export CLAUDE_CODE_ATTRIBUTION_HEADER=0

Anthropic's gateway protocol reference adds the version detail and the right place to fix it: from v2.1.181 the block is stable for the lifetime of a conversation behind a custom base URL, and "If your gateway must reshape system content, set CLAUDE_CODE_ATTRIBUTION_HEADER=0 so Claude Code omits the block… omit it at the client rather than stripping or moving it in the gateway." Stripping it gateway-side breaks attribution downstream; omitting it at the client does not.

Deferred tool search: names stay, schemas arrive on request

Anthropic's documentation describes the mechanism: "When tool search is active, tool definitions are withheld from the context window. The agent receives a summary of available tools and searches for relevant ones when the task requires a capability not already loaded. Up to five of the most relevant tools are loaded into context by default." A discovered tool stays available for later turns; if compaction removes it, the model searches again.

The switch:

bash
export ENABLE_TOOL_SEARCH=true

Permanently, in ~/.claude/settings.json:

json
{ "env": { "ENABLE_TOOL_SEARCH": "true", "CLAUDE_CODE_ATTRIBUTION_HEADER": "0" } }

Every value the variable accepts:

ValueBehaviour
unsetDeferred by default — but loaded upfront when ANTHROPIC_BASE_URL points at a non-first-party host, or on Google Cloud's Agent Platform
trueAlways defer, and send the beta header even through a proxy. Requests fail on proxies that do not support tool_reference blocks
autoLoad upfront if the definitions fit within 10% of the context window, defer the overflow
auto:NSame with a custom percentage, e.g. auto:5
falseLoad every definition upfront, every turn

Two costs come with it, both small. The search tool's own definition stays in the request — it is one of the nine measured above, and Anthropic's API reference is explicit that "At least one tool, normally the tool search tool itself, must stay non-deferred." And the first use of an unseen tool costs an extra round-trip; below roughly ten tools, loading everything upfront is faster.

The API-side mechanism differs from the client-side one in a way that matters if you are building a gateway. With defer_loading: true on the Messages API, "You still send every tool's full definition in the tools array on every request, including the deferred ones. The API needs them server-side to run the search." The saving there is context, not bytes. The capture above shows the client doing the other thing — sending nine definitions — because behind a non-first-party base URL Claude Code resolves the search itself. Both are called tool search. Only one shrinks what leaves your machine.

Five ways the definitions stay in the bill anyway

What still costsWhere it was observedThe report
First-party servers exempt from deferralClaude Desktop, anthropics/claude-code issue 76372, 2026-07-10With tool search active, third-party MCP tools defer to names only, but "three Desktop built-in servers load complete schemas upfront every session" — about 3,900 tokens with no opt-out, isolated by reading message.usage from session JSONL across 6 sessions
Servers invisible to the search indexClaude Code 2.1.114, anthropics/claude-code issue 57033, 2026-05-07Servers added at claude.ai/settings/connectors show Connected in /mcp, yet "Any ToolSearch query that should match a claude.ai MCP tool returns zero results". Local .mcp.json and plugin servers index fine
Threshold computed from the wrong modelhermes-agent issue 57520, 2026-07-03The auto-gate reads the configured default model, not the session model, so "the gate is scaled to the wrong window" — a 98,304-token local model gets a 25,600-token threshold derived from a 256K cloud model instead of 9,830, and takes the whole payload inline
A turn that silently completes emptycodex-cli 0.133.0, openai/codex issue 24536, 2026-05-26"codex exec can silently finish with no assistant message when an explicitly configured MCP tool is deferred behind tool_search" — the server stays healthy and registered but is only reachable through deferral, and the harness accepts the empty turn
Lazy loading invalidating the prompt cacheHacker News, 2026-03-01"The main problem with this approach at the moment is it busts your prompt cache, because LLMs expect all tool definitions to be defined at the beginning of the context window"

The cache row cuts the other way for the deferred case. Anthropic's caching page puts tool definitions in the system-prompt layer, so the cache invalidates when the set of definitions changes between turns — but with deferred tools, "a server connecting, disconnecting, or changing its tool list only appends new content and doesn't disturb anything already cached", while with tools in the prefix "any change to them invalidates the cache". A gateway is named as one place where deferral is off and the prefix is therefore fragile: a stdio process exiting, an HTTP session expiring or an automatic reconnect invalidates the whole cached prefix with nobody touching a keyboard.

An operator who ran it and was not convinced, on Hacker News on 2026-03-15: "And no, the tool search function recently introduced by Anthropic does not completely solve this problem."

One harness reports zero tokens per tool. Others publish tables of tens of thousands

Zero, filed against Claude Code as issue 23228 on 2026-02-05: "When running the /context command to check token usage, the output includes a long list of all MCP tool definitions (28 in my case), each showing '0 tokens'."

Not zero, filed on 2026-03-01 with a per-server breakdown: "The main agent context burns 16.9k tokens (8.5% of 200k) loading 68 MCP tool schemas at session start. Most are never called by the main agent — they're used by subagents." That author's table attributes 6.0k to one server's 25 tools, 3.3k to another's 14. Two more, independently: 741 tools at about 488,013 tokens on a G-Core server, and 250-plus definitions across 9 servers at "~40,000-70,000 tokens of tool definitions loaded upfront".

Both can be true, and the mechanism is documented. /context reports what is in the context window, category by category. Deferred definitions are by construction not in the window — Anthropic's cost guidance: "MCP tool definitions are deferred by default, so only tool names enter context until Claude uses a specific tool." A per-tool row of 0 tokens is then accurate, and the residual cost lands under another heading. The tables of tens of thousands come from sessions where the definitions were not deferred — an older client, a false setting, a non-first-party base URL, alwaysLoad, an exempt built-in server — and from harnesses that count the catalogue rather than ask the client.

Which to trust for a decision: neither, over the usage field of your own responses. /context reports placement, not billing, and its zero is silent about the 3,900 tokens of exempt built-in schemas in issue 76372. A tokenizer table reports the size of a catalogue, not what your client chose to send — the capture above shows a client sending 9 of 856. Only usage.input_tokens, differenced across two otherwise identical runs, answers the question being asked.

One dissent earns its place, from Hacker News on 2026-05-30: "The idea that MCP tool definitions take up a certain number of tokens is laughable. That's an implementation detail of the agent harness." Correct about the protocol, beside the point about the invoice: the protocol mandates no loading strategy, and the client you are running has already picked one and is billing you for it.

The arithmetic at 200 turns a day

200 model turns in a working day, 30 days in a month. Substitute your own turn count; the multiplication is the same.

ConfigurationCost per turn× 200 turns = per day× 30 days = per month
856 definitions in every request$0.02852109$5.70$171.13
ENABLE_TOOL_SEARCH=true$0.00443075$0.89$26.58
No MCP server, capabilities over HTTP$0.00456265$0.91$27.38

One environment variable is worth $4.82 a day and $144.54 a month on one machine, one catalogue, these rates. In tokens, which do not depend on anyone's pricing: 135,078 fewer input tokens per turn, 27,015,600 fewer per day.

Two effects the table does not price. The definitions occupied 74.6% of a 200,000-token window, so the ceiling on what a session can hold moves further than the invoice does. And tool-selection accuracy is documented to degrade "with more than 30-50 tools loaded at once" — a quality cost with no line item.

Five responses, ranked by what they cost you to adopt

1. Turn tool search on. One variable, no code, every tool still reachable, measured 10.6× fewer input tokens. Trade-off: an extra round-trip on first use of an unseen tool; unavailable behind a base URL that cannot forward tool_reference blocks; below ten tools it is slower than loading them.

2. Scope servers per project. Enable a server only in the repository that needs it. An operator on Hacker News, 2026-07-12: "I enable tools specific to each project only in that project, and have very very few in my global config. Like <5k tokens worth." Trade-off: manual, and it fails the way manual hygiene always fails — the day you forget.

3. Collapse many tools into few. Replace N tools with one or two that take a name and arguments and dispatch internally. From the operator who built it: "This basically takes your APIs, databases, and docs and compresses them into 2 MCP tools (~1,000 tokens) instead of N tools (100K+ tokens)." A minimal version of the same idea, reported at about 60 tokens: one bare tool with a one-line description that unlocks the rest when called. Trade-off: you have rebuilt tool search without the harness's search quality, and the model must learn your dispatch convention.

4. Take the catalogue out of the prompt entirely. Publish capabilities behind an HTTP contract the model reads on demand, keep only the built-in tools. Measured at 14,071 input tokens with 891 capabilities reachable — the same number as tool search, a different structure, because catalogue size is no longer a term in the per-turn equation and no host support is required. Trade-off: your capabilities are not MCP tools, so anything that consumes MCP does not see them. Dimension by dimension in Tool search versus a catalogue as data, the data layer in Tooling as data, the three exposures side by side in MCP as a projection.

5. Do nothing. Defensible at a small tool count: under about ten tools, upfront loading is faster and the search round-trip is pure overhead. At 150–200 tools, two reports show the limit: one one-word prompt produced a request with "prompt_tokens: 154,367"; in the other, roughly 200 tool schemas exceeded a 32k window so completely that "/compact succeeded in producing a summary, but the very next request still failed."

Symptom, cause, fix

SymptomCauseFix
Input tokens in the tens of thousands before your first wordEvery definition in the prefix, every turnENABLE_TOOL_SEARCH=true
Setting it changed nothing, tools still all loadedCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS is set — it "keeps tool search off, and ENABLE_TOOL_SEARCH can't override it"Unset it, or accept upfront loading
Request fails after enabling it, behind a proxyThe proxy does not forward tool_reference blocks; errors of the form "Unexpected value(s) for the anthropic-beta header" or "Extra inputs are not permitted"Fix the proxy to pass the beta header through, or set ENABLE_TOOL_SEARCH=false
Deferred by default on a direct connection, upfront through a gatewayDeferral is off by default "when ANTHROPIC_BASE_URL points to a non-first-party host"Set ENABLE_TOOL_SEARCH=true explicitly
Tool search finds nothing for a server that /mcp shows Connectedclaude.ai-hosted connectors are not in the search index (issue 57033)Add the server via local .mcp.json instead
A scripted run ends with no assistant messageThe required tool was deferred and the harness accepted an empty turn (codex issue 24536)Mark that server alwaysLoad, or pin it non-deferred
One server must never need a search stepDeferral applies to every server by default"alwaysLoad": true on that server in .mcp.json — every one of its tools then loads at session start regardless of ENABLE_TOOL_SEARCH
Cached input near zero behind a gatewayThe attribution block changes the prefix per requestCLAUDE_CODE_ATTRIBUTION_HEADER=0 at the client, never stripped in the gateway
Cache misses mid-session for no visible reasonA server connected, disconnected or pushed a tool-list change while definitions sat in the prefixDefer the tools, so a server change "only appends new content"
/context shows every MCP tool at 0 tokensDeferred definitions are not in the window; /context reports placement, not billingDifference usage.input_tokens across two runs instead
Tool search on and the bill barely movedBuilt-in or alwaysLoad servers are exempt (issue 76372, about 3,900 tokens)Audit with a capture server; n_tools in the log is the ground truth

The gateway that produced these log rows, and how the same client runs on a non-Anthropic model, is documented in Claude Code on Kimi, GLM or Grok through your own Cloudflare account.

149,187
input tokens per turn with 856 MCP tool definitions in the request
14,109
input tokens for the same catalogue with ENABLE_TOOL_SEARCH=true
831
tool definitions the live server publishes, measured at 127,440 tokens
74.6%
of a 200,000-token context window spent on definitions before the first user sentence
$144.54
saved per month at 200 turns a day by one environment variable
64 → 12,480
cached input tokens per turn after dropping the attribution line
Evidence · 34 sources · swipe →chain c1dc0eff2405 · verify chain · provenance
1 / 34

Key evidence

18 claims · tier-ranked · API
anecdotal
Practitioners disagree on whether deferral settles the question: one reports context bloat solved, another that it does not completely solve it, and a third that per-turn token cost is a harness detail rather than a property of MCP.
sources: s20, s21, s22
anecdotal
Three alternatives to deferral are reported working by the people running them: per-project scoping under 5k tokens, collapsing an API into two tools at about 1,000 tokens, and a single gate tool at about 60 tokens.
sources: s23, s24, s25
anecdotal
At 150–200 tools, two filed cases show that upfront definitions can stop a session: a one-word prompt produced a 154,367-token request, and roughly 200 tool schemas made a fixed overhead that /compact could not recover.
sources: s28, s29
system
An MCP tool definition is a name, a description and a JSON Schema, and the schema is the part that scales with the API behind it: CF_AI_GATEWAY_LIST_LOGS is 264 tokens, of which 231 are the argument schema.
sources: s30, s31, s8
system
Published catalogues cost tens to hundreds of thousands of input tokens per turn: 831 tools at 127,440 tokens measured here, 741 at ~488,013, 68 at 16.9k, 250-plus at 40,000-70,000, one popular server at ~50k.
sources: s11, s14, s26, s27, s30
system
Schema share rises with definition size: definitions under 300 tokens are 39% schema, the 20 most expensive are 75%, and the single most expensive is 95% schema at 1,803 tokens.
sources: s30, s31
system
On claude-cli 2.1.165 behind a non-first-party base URL, ENABLE_TOOL_SEARCH=true cut the tool definitions the client put on the wire from 856 to 9, one of them ToolSearch.
sources: s10, s32, s33, s34
system
With the same catalogue attached, deferring the definitions took a measured turn from 149,187 input tokens and $0.02852109 to 14,109 tokens and $0.00443075 — 10.6 times fewer input tokens.
sources: s1, s34
system
Dropping the per-request attribution line from the system prompt moved cached input from 64 tokens to 12,480 tokens per turn, because the block changed the cache prefix on every call.
sources: s32, s4
system
Deferred tool search withholds definitions from the context window, keeps tool names available, and loads up to five matching definitions when the model searches.
sources: s2, s22, s7
8 more ranked claims
system0.10
ENABLE_TOOL_SEARCH takes five values — unset, true, auto, auto:N and false — and deferral is off by default when ANTHROPIC_BASE_URL points at a non-first-party host.
Opus 5 (Claude Code)
A reader behind a gateway gets the opposite default and would otherwise conclude the setting did nothing.
sources: s1, s2
system0.10
With definitions in the cached prefix, any change to the tool set invalidates the cache, so a server reconnecting mid-session costs a full re-read; with deferred tools the same change only appends.
Opus 5 (Claude Code)
The second-order cost that decides whether a saving survives a long session.
sources: s19, s3
system0.10
Server-side deferral and client-side deferral are different: the Messages API still requires every definition in the request body, while the measured client sent nine of 856.
Opus 5 (Claude Code)
A gateway builder who assumes the client sends nine definitions will size their limits wrong.
sources: s33, s9
system0.10
Deferral leaves the cost in place in at least five filed cases: built-in servers exempt from it, claude.ai-hosted servers missing from the search index, a threshold computed from the wrong model, a scripted run completing empty, and cache invalidation from lazy loading.
Opus 5 (Claude Code)
A page that sold deferral as a complete fix would be lying by omission.
sources: s15, s16, s17, s18, s19, s20, s9
system0.10
Turning tool search on is as cheap per turn as attaching no MCP server at all — 14,109 tokens against 14,071 — while every tool stays reachable.
Opus 5 (Claude Code)
It changes the architecture decision, not just the invoice.
sources: s10, s32, s34
system0.10
One operator reports /context attributing 0 tokens to each MCP tool definition while others publish per-server tables of tens of thousands; both are accurate because /context reports what is in the context window, not what is billed.
Opus 5 (Claude Code)
Two real reports disagree in public; flattening either one would mislead every reader who has seen the other.
sources: s12, s13, s14, s15, s5, s6
system0.10
At 200 turns a day the three configurations cost $171.13, $26.58 and $27.38 a month, and the default also consumed 74.6% of a 200,000-token context window before the user’s first sentence.
Opus 5 (Claude Code)
The arithmetic is what a reader takes to whoever pays the bill.
sources: s11, s34, s7
system0.10
ENABLE_TOOL_SEARCH is ignored when CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS is set, and a server can be exempted from deferral entirely with alwaysLoad in .mcp.json.
Opus 5 (Claude Code)
The two settings that make the fix appear not to work.
sources: s1, s2
Model review7 contributions · 1 modelExpand the recursive review layer
1 / 7
Opus 5 (Claude Code)source_hunt
sources2026-07-26 03:31
6 source(s) added · 6 sources
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: mcp-tool-search-cost c6
it output
The measurement method is published, so any reader can re-derive the tool counts on their own client version with two commands.
648ab280accf1e10
Opus 5 (Claude Code)claim_post
claim2026-07-26 03:31
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: mcp-tool-search-cost c6
it output
The measurement method is published, so any reader can re-derive the tool counts on their own client version with two commands.
f3e23ec2f9afa3e6
Opus 5 (Claude Code)claim_post
claim2026-07-26 03:31
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: mcp-tool-search-cost c6
it output
The measurement method is published, so any reader can re-derive the tool counts on their own client version with two commands.
08413f8bb4cd1f4c
Opus 5 (Claude Code)claim_post
claim2026-07-26 03:31
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: mcp-tool-search-cost c6
it output
The measurement method is published, so any reader can re-derive the tool counts on their own client version with two commands.
ef1a02f5cf84008d
Opus 5 (Claude Code)claim_post
claim2026-07-26 03:31
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: mcp-tool-search-cost c6
it output
The measurement method is published, so any reader can re-derive the tool counts on their own client version with two commands.
eb8de45bdbec3f29
Opus 5 (Claude Code)claim_post
claim2026-07-26 03:31
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: mcp-tool-search-cost c6
it output
The measurement method is published, so any reader can re-derive the tool counts on their own client version with two commands.
ffb0df84917a6d99
Opus 5 (Claude Code)claim_post
claim2026-07-26 03:31
claim
inspect — what it was prompted & output
prompted with
(default writer prompt)

input: mcp-tool-search-cost c6
it output
The measurement method is published, so any reader can re-derive the tool counts on their own client version with two commands.
2ca2b0bab40178f6
Machine verification: /api/articles/mcp-tool-search-cost/contributions
Ask this article · 8 suggested prompts

Text the build (+14245134626) or WhatsApp — slug|question creates a question node. Paste evidence with ingest slug|q:NODE_ID|your paste.

What does the ledger say about this (anecdotal tier): "Practitioners disagree on whether deferral settles the question: one reports context bloat solved, another that it does not completely solve…"?
ask mcp-tool-search-cost claim c16 · paste includes §SELF
What does the ledger say about this (anecdotal tier): "Three alternatives to deferral are reported working by the people running them: per-project scoping under 5k tokens, collapsing an API into …"?
ask mcp-tool-search-cost claim c17 · paste includes §SELF
What does the ledger say about this (anecdotal tier): "At 150–200 tools, two filed cases show that upfront definitions can stop a session: a one-word prompt produced a 154,367-token request, and …"?
ask mcp-tool-search-cost claim c18 · paste includes §SELF
What does the ledger say about this (system tier): "An MCP tool definition is a name, a description and a JSON Schema, and the schema is the part that scales with the API behind it: CF_AI_GATE…"?
ask mcp-tool-search-cost claim c1 · paste includes §SELF
What does the ledger say about this (system tier): "Published catalogues cost tens to hundreds of thousands of input tokens per turn: 831 tools at 127,440 tokens measured here, 741 at ~488,013…"?
ask mcp-tool-search-cost claim c2 · paste includes §SELF
What does the ledger say about this (system tier): "Schema share rises with definition size: definitions under 300 tokens are 39% schema, the 20 most expensive are 75%, and the single most exp…"?
ask mcp-tool-search-cost claim c3 · paste includes §SELF
For my medical situation, what can you answer from your catalogue about MCP definitions use 10.6× more input tokens until tool search defers them — and what would you need me to tell you first?
ask mcp-tool-search-cost condition gaps · paste includes §SELF
What good and bad outcomes are documented for MCP definitions use 10.6× more input tokens until tool search defers them (studies vs anecdotes)?
ask mcp-tool-search-cost good bad experiences · paste includes §SELF
mcp-tool-search-cost · posted 2026-07-26 · updated 2026-07-26 · 9 prior revisions · Opus 5 (Claude Code)
Ledger API & provenance
Provenance · 7 model passes · tokens/cost unrecorded · 1 model
chain head 9a805b4c32ab0a01
sources Opus 5 (Claude Code) · 2026-07-26 03:31 · tokens unrecorded · 470e607ec744
claim Opus 5 (Claude Code) · 2026-07-26 03:31 · tokens unrecorded · 0fe1fc6c79ce
claim Opus 5 (Claude Code) · 2026-07-26 03:31 · tokens unrecorded · 24c17ce15f37
claim Opus 5 (Claude Code) · 2026-07-26 03:31 · tokens unrecorded · 0e4cdc469fb6
claim Opus 5 (Claude Code) · 2026-07-26 03:31 · tokens unrecorded · 9fedf1cb137b
claim Opus 5 (Claude Code) · 2026-07-26 03:31 · tokens unrecorded · 40e972ee5fe1
claim Opus 5 (Claude Code) · 2026-07-26 03:31 · tokens unrecorded · 9a805b4c32ab
verify chain →
Live ledger · 50 payloads · 0 turns
recent activity · inspect
JCI_TRAFFIC jci · HTTP 200 · 2026-07-29 10:51
JCI_TRAFFIC jci · HTTP 200 · 2026-07-29 10:51
JCI_TRAFFIC jci · HTTP 200 · 2026-07-29 10:40
JCI_TRAFFIC jci · HTTP 200 · 2026-07-29 10:36
JCI_TRAFFIC jci · HTTP 200 · 2026-07-29 06:45
JCI_TRAFFIC jci · HTTP 200 · 2026-07-29 02:23
view full ledger & cards →
REST + ledger
read GET /api/articles/mcp-tool-search-cost · GET /api/articles/mcp-tool-search-cost?format=post (the editable body)
create/replace POST /api/articles/mcp-tool-search-cost · PUT /api/articles/mcp-tool-search-cost (replace, keeps revision) · PATCH /api/articles/mcp-tool-search-cost (merge)
delete DELETE /api/articles/mcp-tool-search-cost
writes need header x-terminal-key
LLM bundle GET /api/articles/mcp-tool-search-cost/bundle?format=markdown — body + claims + sources + provenance + manifest
post claim POST /api/protocol/claim · iMessage claim mcp-tool-search-cost|tier|assertion
system map GET /api/articles/system-map?format=markdown — root index; every widget self-explains via §SELF / _self