Agents, Tool Use & MCP·Question 31 of 90Intermediate

You've connected six MCP servers. There are now 130 tool definitions and ~45k tokens of schema in context before the user says a word. What do you do?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Two separate problems here, and conflating them is the common mistake. One is cost, which caching mostly solves. The other is accuracy, which caching does nothing for, and that is the one that actually hurts.

Full worked answer with diagram

Two separate problems here, and conflating them is the common mistake. One is cost, which caching mostly solves. The other is accuracy, which caching does nothing for, and that is the one that actually hurts.

Cost first, because it is easy. Tool definitions sit at the front of the prompt and do not change within a session. That is a perfect stable prefix, so with prompt caching you pay full price once and a large discount on every subsequent loop iteration. Across a 15-iteration trajectory the amortised cost of those 45k tokens is far lower than the headline number suggests. Do not panic-optimise before checking your cache hit rate.

Accuracy is the real issue. With 130 tools, many overlap. search_docs, find_file, grep_repo, and query_kb all plausibly answer "find the deployment guide". The model picks wrong, or picks a write tool when a read tool would do. Selection error grows with the number of near-synonymous options, and 45k tokens of schema pushes the actual task further from where the model is attending.

What I would do, in order:

  1. Curate per agent, not per server. Whitelist tools. Most servers ship a kitchen sink and you need six of their forty.
  2. Namespace ruthlessly. github_create_issue vs jira_create_issue. Un-namespaced collisions across servers are a large share of wrong-tool errors.
  3. Progressive disclosure. Expose a small always-on set plus a search_tools(query) or per-domain loader that pulls in a group on demand. This turns tool selection into retrieval, which scales better than stuffing.
  4. Split into subagents. Give the GitHub subagent only GitHub tools. Context isolation fixes tool bloat as a side effect.

The measurement that settles the argument: run your eval set with all 130 and with a curated 15. If accuracy is flat, keep them and cache them. It usually is not flat.

Worth sketching. Splitting the two problems on the page stops the conversation collapsing into "just cache it".

flowchart LR
    A["6 servers, 130 tools,<br/>45k tokens of schema"] --> B["Cost: stable prefix,<br/>prompt caching handles it"]
    A --> C["Accuracy: near-synonym<br/>tools, wrong picks"]
    C --> D["Curate per agent,<br/>namespace by service"]
    C --> E["Progressive disclosure:<br/>search_tools(query)"]
    C --> F["Split into subagents,<br/>one domain each"]
    D --> G["Re-run evals:<br/>130 tools vs 15"]
    E --> G
    F --> G

What a good answer covers

  • Two separate problems here, and conflating them is the common mistake
  • One is cost, which caching mostly solves
  • The other is accuracy, which caching does nothing for, and that is the one that actually hurts
  • Tool definitions sit at the front of the prompt and do not change within a session
  • That is a perfect stable prefix, so with prompt caching you pay full price once and a large discount on…

Key terms: Accuracy is the real issue · Namespace ruthlessly · Progressive disclosure · Split into subagents

Interviewer follow-ups to expect

  1. How would you build search_tools without adding a round trip to every task?

  2. A server sends a list-changed notification mid-session. What happens to your prompt cache?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep