Give an agent 80 tools and it picks the wrong one more often
Keep a few core tools loaded, group the rest by prefix and let the agent search for them only when a task calls for them.
In brief
- Once an agent has more than 30–50 tools, its ability to pick the right one declines. Tool definitions can consume tens of thousands of tokens before the user types a word.
- Keep the 3–5 most-used tools always loaded, group the rest under prefixes such as github_ and slack_, and defer them.
- defer_loading only controls what enters the context: every definition must still be sent in every request.
Six MCP servers, 80 tools, one confused agent. Say a client’s agent has just been connected to GitHub, Slack, Jira, a CRM, a warehouse system and an invoicing system. The demo works. But a count shows the agent now has 80 tools, and test users have started complaining that when they ask “which tickets are open”, it creates a new ticket instead.
Editing the system prompt is unlikely to fix this at the root, because the problem most probably lies in the number of tools the agent has to look at at once. Anthropic’s documentation on tool search states plainly that Claude’s ability to select the right tool degrades once the count passes roughly 30–50. At 80 tools, the agent is deep in the danger zone.
The skill required here is designing how the agent sees its tools: which are always visible, which are grouped, and which load only when needed. An FDE who does this well cuts costs and raises accuracy at the same time, instead of patching the system prompt one sentence at a time.
Where do 80 tools cost you?
The first cost is tokens. Anthropic gives the example of a setup with five MCP servers and 58 tools in which the tool definitions alone took up about 55K tokens before the conversation started. The company also says it has seen tool definitions consume as much as 134K tokens before optimization.
Run the numbers: 55K divided by 58 is an average of about 950 tokens per tool. If the client’s tools are of similar length, 80 tools would take roughly 76K tokens. That is a rough estimate, but it is enough to show that a large share of the context is used up before the user types the first sentence.
The second cost is more expensive: accuracy. According to Anthropic, the two most common failures with large tool sets are selecting the wrong tool and passing the wrong parameters. When jira_search_issues and jira_create_issue sit alongside 78 other tools, the line between them blurs, which is precisely the error the test users are hitting.
Group first, defer second
The core idea is simple. The agent does not need to see every tool at once; it only needs to find the right tool at the right moment. Anthropic’s advice is to keep the three to five most-used tools always loaded and defer the rest.
Deferral only works, however, if the agent can find the tools again. That is why grouping must come first. Claude’s documentation recommends naming tools with consistent prefixes by service or resource, such as github_ or slack_, so that a single search matches the whole group. It also suggests listing the tool groups in the system prompt.
OpenAI takes a similar approach: its tool search loads tools dynamically and recommends grouping tools by namespace or by MCP server. It also gives a concrete figure, advising that each namespace be kept under 10 functions to save tokens and help the model perform better.
A worked example: an operations agent for a logistics company
Go back to the 80 tools above. Step one is to sit with real users and ask what they do most every day. Suppose the answer is looking up orders, checking shipment status, finding tickets and posting in the on-shift Slack channel. Those four tools form the core that is always loaded.
That leaves 76 tools. To keep each group under 10 tools, meaning at most 9, simple division shows at least 9 groups are needed, since 8 groups hold only 72 tools.
In practice, the split might be github_, slack_, jira_, crm_, billing_, with the large warehouse system broken into warehouse_inventory_, warehouse_inbound_, warehouse_outbound_ and warehouse_returns_. Any group still above 9 tools gets split further by resource.
A deferred tool looks like this. Note the prefixed name and the description that says clearly when to use it:
{
"name": "warehouse_inbound_list_delayed_receipts",
"description": "List inbound warehouse receipts that are behind schedule, filtered by warehouse and date range. Use when the user asks about late deliveries.",
"input_schema": {
"type": "object",
"properties": {
"warehouse_id": { "type": "string" },
"from_date": { "type": "string", "format": "date" }
},
"required": ["warehouse_id"]
},
"defer_loading": true
}
In the system prompt, add a short passage listing the groups, for example: “Tools are grouped by prefix: warehouse_inbound_ for inbound goods, billing_ for invoices…”. When a user asks about late deliveries, the agent knows to search for warehouse_inbound, and the whole group surfaces in one search.
How does the agent find tools?
Claude offers two server-side search variants: regex and BM25. The practical advice for getting started: if tool names already follow strict prefixes as in the example above, try regex first, because a pattern such as warehouse_inbound_.* will match the whole group.
If users tend to ask in natural language, try BM25 as well and let the eval set decide which variant picks correctly more often.
If the client has many tools with overlapping meanings but different names, you can write your own search logic, for instance with embeddings or semantic search, and return tool_reference blocks from a custom tool. Save this option for when regex and BM25 have failed on your eval set; do not start with it.
In production, remember the prompt cache. OpenAI loads newly found tools at the end of the context window so that the prompt cache stays intact between requests. The lesson applies everywhere: the start of the context, made up of the system prompt and the core tools, should stay stable, with no reordering between calls.
Common mistakes
The most common mistake is assuming that defer_loading makes requests lighter. Claude’s documentation is explicit that the full definition of every tool must still be sent in the tools array on every request, deferred tools included. The flag only determines what goes into the context window, because the API needs the complete definitions to search and expand them.
The second mistake is using tool search for every agent. The documentation says tool search suits cases with 10 or more tools, or definitions longer than 10k tokens. With fewer than 10 tools, or when every request uses every tool, standard tool calling works better. A small client’s six-tool agent does not need an extra search layer.
The third mistake is deferring the core tools too, forcing the agent to search even for tasks it performs ten times an hour. The fourth is arbitrary naming such as getData2 or helper_sync, which breaks any name-based search mechanism.
Prove it with numbers
Do not tell the client the agent is “smarter”. Measure it. On Anthropic’s internal MCP evals, enabling the Tool Search Tool lifted Opus 4 from 49% to 74%, and Opus 4.5 from 79.5% to 88.1%. Anthropic also says tool search cut token usage by 85% while preserving access to the full tool library.
Your numbers will differ, because the client’s data and tools differ. Build a set of real requests, record the correct tool and correct parameters for each, and score separately the two failure types Anthropic identifies: wrong tool and wrong parameters. Run it before and after restructuring, on the same set of requests.
The result also makes a strong line on a CV. For example: “Restructured 80 tools into 4 core tools and 9 prefixed groups with tool search, cutting definition tokens from X to Y and raising correct tool selection from A to B on an N-request eval set.”
A line like that shows measured results rather than a list of tasks done.
Practice on your own agent
The exercise: take an agent you already have, or build one connected to two or three public MCP servers. Print the full tool list on paper, underline the 3–5 tools you believe are core, then sort the rest into prefixed groups of at most 9 tools each.
Next, write 20 requests the way real users would type them, recording the correct tool and parameters for each. Run the set against the old configuration, then against the new one with defer_loading, and count wrong-tool and wrong-parameter errors separately. If one group keeps being mis-searched, its name or description needs rewriting.
The next time a client wants to connect a seventh system, the first question should not be whether it can be done. Ask which group the new tool belongs to and how the agent will find it.
Was this article useful?
Thanks for the feedback!