Tools and MCP servers in the context window
For engineers
Tool definitions and tool results use the window too; too many tools hurt selection, cost and accuracy
110 questions across four stages: Understand, Apply, Solve and Judge.
Try 5 questions
Practice items, not counted towards your mastery. No account needed.
Check yourself · 1 of 5
An agent has five MCP servers connected and you give it a one-line task. When does it pay the token cost of their tool definitions?
Check yourself · 2 of 5
An agent has tools named search, find and lookup with near-identical descriptions. What is the likely result?
Check yourself · 3 of 5
In an agent with many MCP tools, what does deferred tool loading do?
Check yourself · 4 of 5
Tool definitions cost about the same fixed amount on every turn. Why do tool results often end up costing more over a long agent session?
Check yourself · 5 of 5
What is the main context benefit of using a subagent?
Topics
- Tool definitions as a standing token cost4 min read · Every connected tool and MCP server adds names, descriptions and schemas to each request before the task starts
- Wrong tool picks from long tool lists4 min read · Overlapping tools and long tool lists lead to wrong calls, missed calls and slower turns
- Tool search and deferred tool loading5 min read · Loading tool definitions on demand through tool search, skills or code execution instead of all up front
- Keeping tool results compact5 min read · Large API responses, logs and web pages flooding the window; filtering, pagination, truncation and clearing old results
- Subagents that isolate noisy context5 min read · Sending exploration and heavy tool use to a subagent and returning only a condensed result to the main session
Start here
- Introducing advanced tool use (Anthropic) (opens in a new tab)ArticleFree
Shows tool search, programmatic tool calling and tool-use examples, with Anthropic's own measurements of context saved.
- Code execution with MCP (Anthropic) (opens in a new tab)ArticleFree
Explains why many MCP tool definitions and large intermediate results waste context, and the code-execution fix.
- Tool search tool (Claude docs) (opens in a new tab)DocsFree
The API reference for deferring tool definitions and loading them on demand.
110 questions · last verified 2026-12