Reduce MCP Token Usage: How We Cut Our Tool Definitions by 60%
Every MCP tool your agent can call is a block of JSON the model may read on every request. Ours weighed about 95,000 tokens. Here is how to measure yours in two minutes, what we cut without removing a single tool, and the budget check that stops it from growing back.
On 27 October, a paying user cancelled their AgentsRoom subscription and gave tokens as the reason. Before arguing with that, we measured what our app adds to every agent it launches.
The biggest number was not where we expected. Our startup instructions were small. The MCP tools we hand to every agent (backlog, project memory, agent mail, terminals, SSH, databases and the rest) were 191 tools and about 380 KB of JSON. At roughly 4 bytes per token, that is about 95,000 tokens of tool definitions. A week earlier it was 78,000. Nobody had decided that; each new tool had simply added its paragraph.
We build AgentsRoom, a desktop app that runs Claude Code, Codex and other coding CLIs side by side and gives them these tools. This is what we measured, what we cut without removing a single tool, and the check that keeps it from coming back. You can apply all of it to your own MCP servers.
The short answer
- A tool definition is JSON the model may read on every request: name, description, input schema. Count about 4 bytes per token.
- Whether you pay it on every turn depends on the CLI. Claude Code defers MCP tools by default and loads a definition when it needs it. Some CLIs send every schema with every request.
- Measure before you cut.
/contextin Claude Code, or a 40-line script that asks any server for its tool list. - Shorten the text, keep the tools. A description says what and when. The manual moves to a document the agent reads on demand. Ours went from about 95,000 to about 38,000 tokens, 2.5 times less.
- Put a ceiling in the build. Without one, definitions grow back by themselves.
What a tool definition costs, and who pays it
When an MCP client connects to a server, it asks for the list of tools. Each entry is a name, a description written for the model, and a JSON schema of the parameters. The client turns that list into tool definitions sent to the model, which is how the model knows the tool exists and how to call it.
So every word of a description is input the model reads. How often it reads it depends on the client:
- Claude Code defers MCP tools by default. Its documentation, read on 3 November 2026 with Claude Code 2.1.314 installed, says that only tool names and server instructions load at session start, and that a definition is loaded through tool search when Claude needs that tool. With
ENABLE_TOOL_SEARCH=false, withautobelow a threshold of 10% of the context window, on models older than Claude Opus 4 and Sonnet 4, or for a server markedalwaysLoad, definitions load upfront. - Other CLIs differ. In our own test on 28 October, an agent asked to answer "OK": Claude Code opened at 67,500 tokens with our tools deferred, Codex CLI 0.164 opened at 25,000 tokens and did not send our schemas as one block, and OpenCode loaded our 175 tools plus 19 browser tools at connection and sent them with every request. Same server, very different bills.
Prompt caching softens the cost when the tool list does not change: after the first request, a stable prefix is read from the cache at a fraction of the input price. It does not give the space back. The definitions still sit in the context window on every request, next to your code and your conversation. And the deferred mode has a cost of its own: a search step before the first use of each tool.
Measure yours in two minutes
In Claude Code, run /context. It breaks the window down by source and labels MCP tools that are deferred or loaded on demand. Run it in a fresh session in your project, before you type anything, and you see what your setup costs before the work starts.
For any server and any CLI, ask the server directly. An MCP server over stdio speaks JSON-RPC, one message per line: you send initialize, then tools/list, and measure what comes back. This script does exactly that, with Node and no dependency:
// Usage: node mcp-tool-cost.mjs <command that starts the server> [args...]
import { spawn } from 'node:child_process';
const [cmd, ...args] = process.argv.slice(2);
const server = spawn(cmd, args, { stdio: ['pipe', 'pipe', 'ignore'], shell: process.platform === 'win32' });
const tools = [];
let buffer = '';
const send = (msg) => server.stdin.write(JSON.stringify({ jsonrpc: '2.0', ...msg }) + '\n');
const listTools = (cursor) => send({ id: 2, method: 'tools/list', params: cursor ? { cursor } : {} });
server.stdout.on('data', (chunk) => {
buffer += chunk;
let end;
while ((end = buffer.indexOf('\n')) >= 0) {
const line = buffer.slice(0, end).trim();
buffer = buffer.slice(end + 1);
if (line) handle(JSON.parse(line));
}
});
function handle(msg) {
if (msg.id === 1) {
send({ method: 'notifications/initialized' });
listTools();
} else if (msg.id === 2) {
tools.push(...msg.result.tools);
if (msg.result.nextCursor) listTools(msg.result.nextCursor);
else { report(); server.kill(); }
}
}
function report() {
const rows = tools
.map((tool) => ({ name: tool.name, bytes: Buffer.byteLength(JSON.stringify(tool)) }))
.sort((a, b) => b.bytes - a.bytes);
const total = rows.reduce((sum, row) => sum + row.bytes, 0);
for (const row of rows.slice(0, 10)) {
console.log(`${String(row.bytes).padStart(7)} bytes ~${Math.round(row.bytes / 4)} tokens ${row.name}`);
}
console.log(`${rows.length} tools, ${total} bytes, about ${Math.round(total / 4)} tokens`);
}
send({
id: 1,
method: 'initialize',
params: { protocolVersion: '2025-06-18', capabilities: {}, clientInfo: { name: 'tool-cost', version: '1.0.0' } },
});
Run it with the same command your CLI uses to start the server, for example node mcp-tool-cost.mjs npx -y @playwright/mcp@latest. It prints the ten heaviest tools and the total. What we got on 3 November 2026:
| Server | Tools | JSON | About |
|---|---|---|---|
@modelcontextprotocol/server-filesystem 2.1.0 | 14 | 12,554 bytes | 3,100 tokens |
@playwright/mcp 0.0.84 | 25 | 21,034 bytes | 5,300 tokens |
| AgentsRoom tools, 28 October before the cut | 191 | about 380,000 bytes | 95,000 tokens |
| AgentsRoom tools, 28 October after the cut | 191 | about 152,000 bytes | 38,000 tokens |
| AgentsRoom tools, 3 November | 203 | 159,957 bytes | 40,000 tokens |
Four bytes per token is an estimate, good enough to compare servers and to see a trend, not to predict a bill. Real tokenizers vary with the model and the text, as we found when we counted 3.8 billion of our own tokens.
The file servers above are reasonable. The problem is the sum: five servers of that size are already 20,000 tokens, before a server like ours.
What we cut, and what we did not touch
The rule we set: no tool removed, no parameter removed, no allowed value or required field removed. Agents had to keep every capability. Only the text could change.
- A tool description says what and when, in one to three sentences. Not how. The how is where the bytes were: rules, defaults, edge cases, examples, warnings written after an agent once misused the tool.
- A parameter gets one sentence, or nothing when its name, type and list of allowed values already say it all. Parameters that repeat across tools (
project,author, ticket ids) got one standard sentence everywhere. - The manual moved, it was not deleted. Each family of tools has an instruction file the agent reads before its first call to that family. For our largest tool, the one that saves a team of agents, the full field reference is now returned by a tool call when the agent asks for it, instead of riding along in the schema.
- A second pass checked every fact. Each sentence removed from a description was looked up in the instruction files, and put back there when it was missing.
Some of the results, in bytes of JSON per tool:
| Tool | Before | After |
|---|---|---|
teams_save | 19,705 | 9,791 |
triggers_save | 16,014 | 4,071 |
backlog_update | 13,150 | 4,253 |
backlog_create | 11,565 | 4,399 |
In total, 380 KB became 152 KB. Thirteen tools were above 4 KB; four still are, because of the number of fields they carry. The idea behind the whole pass: to choose a tool, the model needs to know it exists and when to call it. The details can wait until the moment it uses it.
If you write an MCP server, Claude Code gives you one more reason. It cuts a tool description loaded upfront at 4,096 characters, and when it matches a search against a description it reads only the part within that limit. Anything important after that point may never be seen.
The same trick for a startup file
Tool schemas are not the only fixed cost. Our agents also read an instruction file about the tools before using them, and it had grown to 57.7 KB, about 14,000 tokens, read in full at every start and every resume. A user reported that a resumed Codex agent reached its working context limit within minutes.
The fix was the same idea. The file became an index of about 11 KB: the rules that apply to every tool, and one line per family of tools pointing to its own file. The 31 family files are read only before the first call to that family. Their text did not change, word for word. An agent that only touches the backlog never reads the section about databases.
This works for any long CLAUDE.md or AGENTS.md too: keep in the always-loaded file what every task needs, and link the rest. We wrote more about that in our guide to AGENTS.md and context files.
A budget that fails the push
The number that worried us most was not 95,000. It was 78,000 a week earlier. Every tool added a paragraph, every paragraph was reasonable, and the sum grew by 20% in seven days.
So the size became a build check. One JSON file holds the budget:
{
"totalBytes": 160000,
"perToolBytes": 4000,
"oversized": {
"teams_save": 9791,
"triggers_save": 4071,
"backlog_update": 4253,
"backlog_create": 4399
}
}
A script starts our MCP servers in a sandbox, asks each one for its tools, measures JSON.stringify(tool) in bytes and exits with an error when the total passes totalBytes or when a tool passes perToolBytes. The four tools that were already too large are listed with their size: a ratchet. They may shrink, never grow, and when one shrinks the script asks to lower the number. It runs before every push and in the release build. Raising the ceiling is possible, but it is a decision written in the file, not a way to make the check pass.
On 3 November, six days later, the same check reads 203 tools and 159,957 bytes: twelve tools added, 43 bytes under the ceiling. The next tool will have to make room for itself. That is exactly what the check is for.
Switch off what you do not use
The cheapest token is the tool your agent never sees.
- Scope servers to the projects that need them. A server declared at the user level follows you into every repository. In Claude Code, a project
.mcp.jsonkeeps it where it is useful. - Keep
alwaysLoadfor a handful of tools. Claude Code's documentation says it plainly: each upfront tool consumes context that would otherwise be available for your conversation. - Watch what tool results add, not only the definitions. A tool that returns a whole page or table can cost more in one call than its definition costs all day.
In AgentsRoom, Settings > AgentsRoom tools lists every family of our tools with its weight, and you can switch off a family or a single tool, for every project, one project, a folder or one agent. A switched-off tool is not listed to the agent at all, so it costs no context. The AgentsRoom MCP page describes the tools, and the session trace shows what filled an agent's context, MCP tools included, ranked by size.
What we did not change
Two other costs came out of the same measurement, and we left them alone on purpose.
- The startup brief that tells each agent its role and how to report its status: a median of about 5,000 tokens for Claude, about 2.5% of a 200,000-token window, and read from the cache from the second request on.
- The status file each agent writes at the end of a turn: measured on 71 local Claude transcripts, about 2.5% of the context tokens.
Shrinking either would have saved less than 3% of the window and risked the quality of the agents' work. The tool definitions were 95,000 tokens. That is where the time went.
Questions people actually ask
How many tokens do MCP tools use?
Each tool costs its whole definition: name, description and input schema, sent as JSON. A rough rule is 4 bytes per token. Measured on 3 November 2026: the official filesystem server lists 14 tools for about 3,100 tokens, Playwright MCP 25 tools for about 5,300. The AgentsRoom tools weighed about 95,000 tokens before we shortened them, about 40,000 today.
Does Claude Code load every MCP tool into the context window?
Not by default. Claude Code's tool search defers MCP tool definitions: only the tool names and the server instructions load at session start, and Claude loads a definition when it needs that tool. Setting ENABLE_TOOL_SEARCH=false, a model older than Claude Opus 4 and Sonnet 4, or a server marked alwaysLoad puts the definitions back in the context upfront.
Do MCP servers reduce token usage?
They can, when a tool returns a short answer instead of something the agent would otherwise read in full, like a database query instead of a dump. But the definitions cost context, and so do the results: Claude Code warns when one MCP result passes 10,000 tokens and cuts it at 25,000 by default. An MCP server saves tokens only when its results are smaller than what it replaces.
How do I see how much context my MCP tools take?
In Claude Code, run /context: it breaks the context down by source and labels the MCP tools that are deferred. For any server and any CLI, ask the server for its tool list and measure the JSON, which is what the 40-line script in this article does.
What makes a good MCP tool description?
One to three sentences that say what the tool does and when to call it, with the words an agent would search for near the start. A parameter gets one sentence, or nothing when its name, type and allowed values already say it. Rules, edge cases and long examples go in a document the agent reads on demand. Claude Code cuts a description loaded upfront at 4,096 characters anyway.
How do I keep tool definitions from growing back?
Give them a budget the build can check. We keep a JSON file with a total ceiling and a per-tool ceiling, a script that starts our MCP servers, measures every tool and exits with an error above either limit, and we run it before every push. Tools that were already too large may shrink, never grow.
The short version
Your MCP tools are text the model reads, and nobody reviews that text the way they review code. Measure it once: /context in Claude Code, or the script above for any server. Then make each description say what and when, move the how into a file the agent reads when it needs it, and put a number in your build so it cannot drift back.
We went from about 95,000 to about 38,000 tokens without removing a tool. If you run several agents with the same tools, AgentsRoom is free to download, and the MCP servers page shows how to declare a server once for every CLI and project.
Download AgentsRoom
Run all your AI agents, on all your projects, from a single window.
Companion app: monitor your agents on the go
Bring your own: Claude, Codex, Antigravity CLI, or other AI provider.
Push bugs and requests straight to your public backlog.
Agents you read like a conversation
Each agent has a role, a face, and a thread you read like a messaging app.

Keep reading
How to Cut Your Claude Code Token Costs Without Slowing Down
Claude Code bills you per token, and most of the spend is invisible: bloated context, the wrong model, raw PDFs, agents re-reading the same files. Here is where the money actually goes and how to cut it, with the habits and tools that keep your bill low without slowing you down.
Read the articleConvert PDF to Markdown to Save LLM Tokens: The MarkItDown Guide
Feeding PDFs straight to Claude or any LLM quietly burns tokens: every page is also turned into an image. Convert the file to Markdown first with MarkItDown, Microsoft's free open-source tool, and cut your token bill by up to 80%. Full guide with CLI, Python, and MCP setup.
Read the articleHow to See What Your AI Coding Agent Runs on Your Servers
Your agent is on a production server and the terminal only says it is calling a tool. Which command did it run, and what did the machine answer? The transcript tells you afterwards. Here is how we made it visible while it happens, what we tried first, and how to get the same thing without our app.
Read the article