# With more than a dozen tools available, Agents first fail by choosing the wrong one

Date: 2026-12-01
Category: Technology
Tags: Agent, Tool Design, Evaluation
Summary: Once the number of tools increases, Agent failures shift from parameter errors to selection errors. This article breaks down the specific practices of layered exposure, merging synonymous tools, and candidate set evaluation.

When an agent gets its fifteenth tool, the problem usually isn't that it can't call them—it's that it starts hesitating among several tools that could all do the job. Every additional tool in the registry gives the model one more option it has to rule out; when those options' descriptions all contain "query," "order," and "export," picking the wrong one is only a matter of time.

A common scenario is a customer-service agent. At first it had only three tools—look up order, change address, process refund—and ran steadily. Then the logistics team added track shipment, the finance team added issue invoice, and the operations team added send coupon; every team felt its own tool was essential. The tool count grew from single digits to twenty-odd. Each tool works fine on its own, but together they start causing problems: the user says "refund" and the agent calls cancel order; the user says "check refund progress" and the agent looks up payment records.

These errors are different from wrong parameters. Wrong parameters can usually be caught by validation; wrong selection often sails right through: the tool returns a seemingly relevant result, the model keeps generating on top of it, and the user ends up with an answer that is semantically correct but about the wrong object. Worse, in single-tool evaluations every tool is correct—the problem only appears in the full candidate set.

## Each tool is right on its own, wrong together

Many teams evaluate tools like this: give each tool ten queries, and put only that tool plus two random negatives in the candidate set. Pass rates quickly look good, so the conclusion is that the tool is usable. But the error rate won't come down after launch, because real requests don't face two random negatives—they face a dozen semantically adjacent tools.

The user says "export last month's refund orders to finance." The candidates include `query_refund`, `export_refund`, `create_report`, `send_email`, `query_order`. Every tool's documentation says "refund," "order," "export," "send," so the model easily calls `query_refund` first, then hands the result to `send_email`. It looks like the task is done, but the export and permission checks never happened. This isn't the model failing to use tools—it's the candidates not being distinguishable enough from one another.

The first thing to change in evaluation is to switch negatives from random to near-neighbors. If the correct tool is `export_refund`, the negatives should be `query_refund`, `create_report`, `query_order`—not weather and calendar. Only near-neighbor negatives can test whether the model understands the boundaries. The second thing is that evaluation must run on the real candidate set, not a candidate set shrunk down to just the correct tool. A shrunken candidate set only proves the tool can be called; it doesn't prove the model can pick it correctly.

## Once the candidate set grows, the model loses on elimination first

Tool count itself isn't the only cost. A tool with parameter descriptions takes roughly one to three hundred tokens in context; twenty of them is two to three thousand to start. What's expensive isn't just those tokens—it's that the model has to eliminate among them. Every tool's description competes for attention; the more alike the descriptions, the harder the elimination.

What really affects selection is the number of tools competing with each other under the current request, not the total registry size. A weather tool, a calendar tool, and a calculator are orthogonal; adding them up to ten may not cause trouble. Conversely, six tools all called "order lookup" can make the model pick wrong even if the total is small. Tool count is only the surface; confusion is the real variable.

Confusion comes from several places: the same object with multiple verb variants, such as look up user, search user, find user by phone number; the same action with multiple permission versions, such as normal refund and manual refund; descriptions full of boundaryless words like "query," "manage," "handle." When the model selects tools, it doesn't select by code call chain—it selects by semantic similarity. The more the descriptions overlap, the more likely it picks the one that looks most similar rather than the most correct.

There's an easily overlooked cost here: wrong selection pushes cost downstream. After picking the wrong tool, the model may keep using the wrong result for the next step; the longer the call chain, the more expensive the correction. A wrong read costs the user a few extra seconds; a wrong write may change state, send notifications, or produce a refund. Tool-set governance isn't fussiness—it's putting a ceiling on errors.

## Layered exposure: give the catalog first, then the tools

Once there are many tools, the default approach isn't to write a longer system prompt but to split exposure into two layers: first let the model choose a capability domain, then expose only the tools in that domain. The catalog layer only says what each domain covers and doesn't cover, without expanding parameters; only within a domain is the full schema given.

The chain below answers where a request should narrow its candidate set.

```mermaid
flowchart TD
    A[用户请求] --> B{先判能力域}
    B -->|订单| C[订单域 3到5个工具]
    B -->|退款| D[退款域 3到5个工具]
    B -->|不确定| E[澄清或列目录]
    C --> F[域内选工具]
    D --> F
    E --> F
    F --> G[执行并记录候选集]
```

The most important thing in this diagram isn't the extra decision—it's that a wrong decision still has a fallback. Domain routing can be cheap: a small model, rules, or a short classification will do. It doesn't need to get it right in one shot; it only needs to expand the catalog to the model or ask the user when uncertain. What's least acceptable is stuffing all tools into context by default and hoping the model picks correctly among twenty options in one go.

How should domains be split? By user task, not by team organization. Orders, refunds, logistics, accounts—these are task boundaries users can perceive; transaction middle platform, fulfillment platform, financial settlement—these are internal organizational boundaries. If the tool catalog is split by team, the model sees "finance tools" and "fulfillment tools," but it doesn't know who should own the user's "refund." The catalog layer should use user language, not organizational language.

How many tools to expose per domain: start with five to eight. This number isn't a model limit—it's so evaluation can cover pairwise confusion. Above eight, first see whether the domain can be split; below three, consider whether it should be merged back into the layer above. Write operations should be narrower: a wrong read tool costs a few seconds; a wrong write tool may change state, send messages, or move money, and can't be covered by retries.

## Narrowing the candidate set: merge synonymous tools, cut pseudo-tools

Layering only splits the candidate set; reducing selection difficulty still requires merging. Many so-called new tools are just old tools with a different verb. `get_user`, `query_user`, `search_user`, `get_user_by_phone` can be merged into a single `find_user`, distinguished by three parameters: `by_id`, `by_email`, `by_phone`. The model doesn't need to know four tool names; it only needs to know the one action "find user."

Merging isn't cramming twenty tools into one `manage_order` and using a twenty-item action enum. That just moves the tool-level selection error down to the parameter level—the model still has to choose among twenty actions. The goal of merging is to reduce options at the same decision point, not to turn the interface into a universal remote.

| Situation | Handling | Boundary |
| --- | --- | --- |
| Query variants of the same object with the same permissions | Merge into one tool, distinguish by parameters | If the parameter enum exceeds five or six, consider splitting again |
| Reads and writes | Separate by default | Cannot merge when the write requires confirmation or approval |
| Cross-domain orchestration | Put it in an upper-layer flow, not a single tool | Don't let one tool handle both orders and refunds |
| Descriptions containing "manage" or "handle" | Rewrite as specific actions and counterexamples | State clearly in the tool description what it does not do |

Tool descriptions should state boundaries, not marketing lines. "Cancel order" saying only "cancels unpaid orders; paid orders go through refund" is far more useful than "supports order cancellation capability." When the model eliminates among candidates, counterexamples often help it distinguish better than positive examples.

The catalog layer can be as simple as this one page:

```yaml
domains:
  - name: order
    scope: 查询和修改订单状态，不处理退款
    tools: [get_order, cancel_order, update_address]
  - name: refund
    scope: 退款申请和进度查询，不处理支付失败
    tools: [create_refund, get_refund]
  - name: logistics
    scope: 查物流轨迹和修改收货时间
    tools: [get_tracking, update_delivery_time]
```

The purpose of the catalog layer is not to make the model remember every tool, but to let it know which layer to look in. If the catalog is too detailed, it effectively exposes the full tool set all over again; if it is too coarse, the model can only guess. One sentence per domain, stating what it covers and what it does not, is enough.

## Logging and evaluation: look at the candidate set first, then the call

When a tool is chosen incorrectly, many logs record only the name and parameters of the tool that was ultimately called. Such logs make post-mortems impossible: was the tool not exposed, was the domain routed incorrectly, was the description too similar, or were the parameters filled in wrong? These four causes map to four different fixes; mixed together, you can only guess.

I record at least four things: the original request text, the domain it was routed to, the list of tools exposed at that moment, and the tool finally selected. Recording the scores or ranking of candidate tools is better; if you cannot, it is not essential. The key is to fix the candidate set so the same request can be replayed. A log without a candidate set shows only the outcome, not the choice space.

Evaluation follows the same idea. Sample a batch of real requests, label each with the correct tool, add two or three near-neighbor negative samples, and run two groups: the full candidate set and the layered candidate set. If the full set degrades badly while the layered set recovers, the problem lies in candidate-set governance, not model capability. Only when both groups degrade should you look at the model and the prompt.

Do not look only at the final success rate. After choosing the wrong tool, the model may retry once and get it right; the final success rate will not show this, but latency and cost have already gone up. First-attempt accuracy and average number of tool calls are more sensitive. A drop in first-attempt accuracy and a rise in retries usually show up earlier than user complaints.

## Not every Agent needs layering

Layering itself has a cost: one more routing decision, one more failure point, and extra latency. When there are fewer than eight tools, they are mutually orthogonal, and there are no synonymous tools, exposing everything directly is simpler. My current default is to start domain routing only when the tool count reaches the teens, or when two or more groups of near-synonymous tools appear; write operations do not wait for this threshold and are always narrowly exposed.

There is another boundary: if tool-selection errors occur mainly in parameters rather than tool names, do not add layering yet; first get the parameter schema and validation right. Layering solves "which tool to choose"; it does not solve "the right tool was chosen but the parameters were filled in wrong." Keep the two kinds of errors separate so that changes do not mask each other.

Before adding a tool to an Agent next time, ask one question: is it a new capability, or another name for an old one? If the latter, merge it first; if it really is a new capability, then think about which domain it belongs to and when it should be exposed. More tools is not better, and a larger candidate set is not stronger. Letting the model see only the options it should see at each step is more reliable than making it remember all the options.
