How much money are you wasting on MCP tool calls?
One MCP tool response contained 508,000 tokens. A few changes cut an eval's token use by 95%, with no measured loss in quality.
Have you checked recently?
Recently at work, while digging through some MCP server tool-call patterns, I discovered tools returning hundreds of thousands of tokens. One particularly egregious call ended up returning 508 THOUSAND tokens. The culprit was gigantic rows of pretty-printed JSON loaded directly into the context window, without any cap on how big the JSON got.
And it got big.
With a few tweaks, I was able to reduce the MCP server token spend from 4.70M to 236k for a single eval1 run, with the average task being completed 31% faster, all without any reduction in quality. That one optimization saved almost $15 per run!
That's roughly 95% fewer tokens. The changes involved capping tool responses, dropping duplicate and rarely used fields, stopping pretty-printing, and adding clearer descriptions: when to use each tool, where IDs come from, and how to page through results.
Contents
- What MCP actually does
- Where the tokens go
- Give the model less work to do
- Why output limits aren't a budget
- Measure the completed task
- The old engineering rules still apply
What MCP actually does
If you already know what MCP is, you can skip the next two sections.
MCP stands for Model Context Protocol. It's a standard interface connecting AI applications to tools and data: document searches, databases, support tickets. The application tells the model what each tool does and which arguments it accepts. When the model requests a call, ordinary software executes it and can return the result to the model.
Suppose you ask an assistant which support tickets need attention. It calls a ticket-search tool, reads the results, and explains which ones matter. MCP lets applications and servers use the same interface instead of building an integration for every pairing.
Where the tokens go
Language models process text in tokens, small pieces of words and punctuation. The context window holds the material a model can work with in a request: instructions, conversation history, tool definitions, and results. With usage-based pricing, you pay for input tokens the model receives and output tokens it generates.
When the application forwards a tool's output to the model, that output becomes input to the next request. Forward a huge JSON object and you've handed the model a huge reading assignment, even if the user's question only needed three fields.
If the application keeps the result in conversation history, later requests may include it again. One response's size and a task's cumulative input tokens are different measurements. Caching can discount reused input; context management can remove or condense it. Neither makes an oversized response a good default.
It's worth remembering that using an MCP server isn't a fixed cost. It is additive every time you use the server. Every extra token adds up. MCP itself doesn't set a price per call; the cost depends on what the server returns, what the application sends to the model, and how many model turns the task takes.
A poorly optimized MCP server is basically a license for an agent to sneak hundreds of thousands of extra tokens onto your compute bill, all without the person using it suspecting a thing.
Give the model less work to do
Start with the fields. A search result usually needs enough information to identify a relevant record and decide whether to fetch it. Full record bodies and rarely used metadata can wait for a detail request. Keep the IDs needed for follow-up calls.
Then bound the response. Accept filters and page sizes, set conservative defaults, and enforce a maximum on the server. Make additional pages discoverable.
For example, a ticket search could return:
{
"tickets": [
{"id": "T-104", "title": "Login fails after reset", "priority": "high"},
{"id": "T-109", "title": "Invoice missing", "priority": "normal"}
],
"returned_count": 2,
"has_more": true,
"next_cursor": "page-2"
}
This gives the model enough to select a ticket, fetch its details, or request another page. Without pagination information, two results could look like the complete answer.
A row limit also needs a size limit. Twenty records can still be enormous if each contains a long conversation or an embedded document. Bound individual fields or return excerpts with a way to retrieve the full text. Truncate at a meaningful boundary and state what's missing; cutting a JSON string halfway through isn't a usable interface.
Removing indentation and redundant fields helped my tools. But an unnecessary audit history can cost much more than whitespace. Count tokens with the model's tokenizer, and check that the compact response remains understandable.
The descriptions matter too. Explain when to use the tool, where required IDs come from, and how filters and pagination work. A parameter called id tells the model very little if three other tools return different kinds of IDs. A slightly longer description can save a failed call and a recovery turn.
Tool definitions also take space when they're included in model context. Keep them clear, remove duplication, and use on-demand discovery where the application supports it.
Finally, move mechanical work into code. If the question is how many tickets are open, let the database count them. If the task is to transfer records between services, keep the full payload in the execution environment and return the resulting IDs and a success or failure summary.
If you're using someone else's server, you still have some control: request a narrow search, specify fields or limits where supported, and inspect the results. If the tool exposes no way to do that, its interface is worth raising with the maintainer.
Why output limits aren't a budget
You might think that you can get around this by limiting how many tokens a tool call can use. Check what happens when the result exceeds it.
As of October 2026, Claude Code documents a default MCP output limit of 25,000 tokens, configurable through MAX_MCP_OUTPUT_TOKENS. Some tools can declare their own text-size threshold. When an oversized result contains no images, Claude Code saves it to a file and substitutes a message containing the file path into the conversation. Claude can then read that file when it needs the content.
Saving a file doesn't put its contents into context. Subsequent reads can. If the agent reads enough of it, one single unoptimized tool call result can theoretically pollute your entire context window. The limit controls the initial response, not the task's total input tokens.
As a side note, capping the tool-call output limit can have an interesting effect on performance. What you save in tokens you might end up paying for in extra turns of the conversation while the agent reads through the saved result. If it can search the file and read only the relevant section, the same mechanism may save both time and tokens. Measure which path your agent actually takes.
Measure the completed task
Inspect a completed task's trace: its tool calls, responses, and model turns. Find the largest responses and follow what happened after each one. Did the agent use most of the returned fields? Did it fetch the same data twice? Did an unclear description send it to the wrong tool?
For each change, compare task success or answer quality, total input and output tokens, elapsed time, tool calls, and retries. Track actual cost alongside tokens, since model rates, cached input, and pricing tiers affect the bill.
An average can conceal an occasional enormous response, so inspect the worst cases too. A rare half-million-token result deserves attention even when the typical call is small.
The smallest response isn't automatically the best one. Aggressive caps can force the agent to walk through dozens of pages; deleting a useful field can force a second lookup. Include tasks that genuinely need the larger record, and repeat comparisons when the results are close.
Optimize for cost per successfully completed task.
The old engineering rules still apply
Computer scientists and programmers spent decades coming up with ways to shave milliseconds off low-level function calls and make sure that memory was managed efficiently. They invented cleverly designed programming languages that made full use of the microscopic silicon they ran on.
But now we can route even routine filtering and data transfers through LLMs, these lumbering, slow, and excessively verbose computing abstractions, running on orders of magnitude bigger machines, all to do the exact same jobs that we were accomplishing with Java microservices not ten years ago.
It's enough to make a Rust programmer weep.
Letting people ask questions without knowing which API to call is useful. It also makes the engineering underneath more consequential: select the columns you need, avoid unnecessary copies, and compute close to the data. The person asking usually sees only the answer. The waste stays hidden until you inspect the trace or the bill.
In On Coding With AI, I wrote that burning $1,000 worth of tokens doesn't mean you produced $1,000 worth of value. The same applies to tool calls. A complete response can contain almost nothing the task needed.
Before you pay a model to read more, ask what it needed to read in the first place.
Further reading
- Model Context Protocol: architecture overview
- Anthropic: writing effective tools for agents
- Anthropic: code execution with MCP
- Claude Code: MCP output limits and warnings
- Google: understanding and counting tokens
Footnotes
- An eval is a set of tasks used to test an agent. This one ran on Gemini 3.1 Pro, with Gemini 3.8 Flash judging response quality. The judge's scores were unchanged on these tasks. A casual user might miss the token savings. But the token bill at the end would definitely not be invisible. ↩