Topic 4 of 5 · 4 min read
The context cost of many connected tools
Goal: Estimate the context spent on connected tool definitions and choose which servers to drop, defer or replace with a CLI command.
Every connected tool has a definition, and the model reads all of them on every turn, so each unused tool costs context you could have spent on the task. This is the quiet price of connecting many servers.
Check yourself · 1 of 3
Why does an unused MCP tool still cost you something?
Why it matters
A tool definition is a name, a description and an input schema, as the MCP tools specification describes. The agent places these in the model's context so it knows what it can call. A server with thirty tools can add thousands of tokens before you type a word. That space is shared with your instructions, the files the agent has read and the conversation so far. Crowded context means higher cost, slower replies and a model that is more likely to pick the wrong tool or lose track of earlier instructions.
How to measure it
Most agents show context use. In Claude Code the /context command breaks it down, and tool definitions appear as their own line. Compare it with and without a server connected, and note the difference per server.
Your options, in order
- Drop it. If you have not used the server this week, disconnect it.
- Trim it. Deny or disable tools the task does not need. This also reduces risk.
- Defer it. Some agents load tool definitions only when needed, using search over tool names. The model sees a short index, then pulls the full definition when it chooses a tool. Check your agent's docs for this setting.
- Replace it with a CLI. If a command-line tool already exists, such as
ghfor GitHub, the agent can run it through the shell. The model usually knows common CLIs already, and nothing is added to every turn.
Before and after
Weak: ten servers connected "just in case", about forty tools visible in every session.
Fixed, as a table you keep in the project notes:
| Server | Used for | Decision |
|---|---|---|
| issues | Daily triage | Keep, trim to 4 tools |
| browser | Rare UI checks | Defer |
| git host | Pull requests | Replace with the gh CLI |
| calendar | Never used | Remove |
What goes wrong
- Measuring once, then adding servers for months without looking again.
- Replacing a server with a CLI that needs a secret in a shell history.
- Deferring a server and forgetting that the first call in a session will be slower.
- Cutting tools so hard that the agent cannot do the task and wanders.
Examples
Measuring one server
You run /context before and after connecting a project-management server. Tool definitions grow noticeably, yet you call only get_ticket. You deny the other tools. Context drops back and the agent picks tools more reliably.
Swapping a server for a CLI
A source-host server offers dozens of tools. You only list pull requests and read review comments. The gh CLI does both with two commands, so you disconnect the server and add a line to the agent's memory file saying to use gh for pull requests.
Key points
- Tool names, descriptions and schemas are sent to the model every turn, so connected tools cost context even when unused.
- Measure the cost with your agent's context view, with and without each server.
- Decide per server: drop it, trim its tools, defer its loading, or replace it with a CLI command.
- A well-known CLI such as
ghoften does the job with no per-turn cost. - Review the list on a schedule, since servers accumulate.
Common mistakes
- Connecting servers "just in case" and never removing them.
- Judging by tool count alone instead of measuring tokens.
- Replacing a server with a CLI without checking what credentials the CLI needs.
- Trimming so many tools that the task becomes impossible.
Check yourself · 2 of 3
Which choice usually adds nothing to every turn's context?
Check yourself · 3 of 3
You have not used a connected server in weeks. What is the best action?
Practice items, not counted towards your mastery.
Start here
- Connect Claude Code to tools via MCP (Claude Code docs) (opens in a new tab)DocsFree
Exact commands, scopes, environment-variable expansion and authentication for adding servers.
- MCP security best practices (opens in a new tab)DocsFree
The protocol's own list of attacks on servers and clients, with the mitigations to apply.
- MCP Inspector (opens in a new tab)DocsFree
A standalone tool to call a server's tools by hand and see raw requests and errors.
More for this topic
- MCP specification: tools (opens in a new tab)StandardFree
What a tool definition contains: name, description and input schema, which is what costs context.