Tool-Design Anti-Patterns

9 min read

K6
Deep Dive · Tool & Capability Design

An anti-pattern is defined against a calling convention, and the convention moved.

The four classic tool-design defects are still real and still cost you traces, but they are now the cheap half of the audit — each is a one-minute read of a schema with a mechanical fix. The expensive half is the one nobody wrote down in 2024: the catalog itself. Anthropic's own engineering post reports internal tool definitions consuming 134K tokens before optimisation, against roughly 500 for an on-demand search tool. Audit the four, then audit the shape of the list.

Step 1The kitchen-sink tool: one call with a mode flag that is really five tools.

The signature: a single tool with an action or operation argument and a schema where most fields are conditionally relevant — half apply only when action="create", half only when action="delete". The model must first pick the tool, then pick the mode, then work out which fields this mode needs, and it gets the mode wrong or fills the wrong field set. The fix is K2's split: one tool per action, each with a tight schema. The trace tell is the same tool called with internally contradictory arguments.

# Anti-pattern: kitchen-sink, conditional fields
manage_user(action: str, id=None, name=None,
            email=None, role=None, hard=None)

# Fix: one tool per action, each schema tight
create_user(name, email, role)
delete_user(id, hard=False)

Note what the fix costs, because it is the hinge for STEP 5: splitting one kitchen-sink tool into five tight ones makes each call more reliable and makes the catalog five entries longer. That is the right trade at five tools and a questionable one at five hundred, which is exactly why the two halves of this audit have to be run together rather than in sequence.

Step 2Stringly-typed arguments: a free string where a structure belonged.

The signature: a parameter typed string that actually expects a date, an enum value, a JSON blob, or a query DSL the model has to construct from nothing. Free strings are where the model puts plausible garbage — "next Tuesday" into a field that wanted 2026-11-26, "high priority" into a field that wanted P1. The fix is K3: replace the string with an enum, a typed field with a format, or a structured object, so the bad value cannot be expressed.

Grep your tool definitions for parameters typed plain string with no enum, format, or pattern. Each one is a place the model is currently free to hallucinate; most of them wanted a constrained type and nobody tightened it.

One 2026 caveat on the fix: the constraint only binds if the provider actually enforces the keyword you used. JSON Schema support is a per-vendor subset, not a standard — if your pattern is silently dropped on the way in, you have a document, not a contract. Check your own provider's accepted subset before you count the field as fixed, and keep server-side validation regardless, because a schema the model obeys 97% of the time still fails 3% of the time.

Step 3Silent failure: the tool returns success when nothing happened.

The signature: a tool that catches its own exceptions and returns an empty list, a default object, or a bare 200 instead of an error. This is the most dangerous anti-pattern because it produces no local symptom — the agent proceeds confidently on a false premise, and the failure surfaces many steps later as behaviour no trace can localise to a cause. The fix is K4: fail loudly, report partial success as partial, never let "nothing happened" look like "it worked."

"Return empty on error so the agent doesn't crash" is the single most expensive convenience in agent engineering. The agent does not crash — it confidently does the wrong thing for ten more steps, and the postmortem cannot find where it went wrong because the tool erased the evidence.

The worked cost, on a fleet running 10,000 tool calls a day with a 2% underlying error rate: 200 failures. Returned as errors, the agent retries or escalates and the damage is bounded by the retry policy. Swallowed, those 200 become 200 runs that each continue for an average of, say, six more steps on a false premise — 1,200 steps of work that is wrong and looks fine, and a triage queue in which the originating call is invisible by construction. The anti-pattern does not raise your error rate; it deletes your ability to measure it, which is worse, because the number on the dashboard improves.

A tool that cannot fail visibly cannot be debugged. If a reviewer cannot tell from the tool's return value whether the world changed, the return value is not an observation — it is a guess the agent will treat as fact.

Step 4The leaky abstraction, and why these four rarely travel alone.

The signature: a tool whose arguments or outputs are shaped by the backend, not the task — pagination cursors the model has to thread, internal status codes, raw join keys, a db_query that makes the model author SQL. The model is forced to reason about your storage layer instead of the user's goal, and it reasons about it badly. The fix is K1: design the tool around the task and hide the machinery.

Then audit for the other three, because a kitchen-sink tool is usually also stringly-typed (the action argument) and often leaky (it mirrors a CRUD endpoint), and it tends to fail silently because broad tools have broad, vague error handling. Fixing the granularity frequently dissolves the typing and abstraction problems at the same time, because a task-shaped tool has nowhere to leak and nothing to mode-switch on. That correlation is the practical reason to start the audit at granularity rather than at schemas.

There is one leak worth re-examining in 2026, though, and it is the pagination cursor. Threading a cursor through a model's context was always ugly; it is now also the wrong layer, because a tool whose results run to thousands of rows should be handing the model a reference it can operate on rather than a page it has to reassemble turn by turn. The anti-pattern has not changed. The available fix has.

Step 5The fifth anti-pattern, and the one that now dominates: shipping the catalog up front.

Every definition in your tool list is paid for on every turn, before the model does any work, whether or not the task could possibly use it. Anthropic's engineering write-up on advanced tool use puts a number on its own internal case: tool definitions consumed 134K tokens before optimisation, against roughly 500 tokens for loading only a search tool and discovering the rest on demand. That is the whole anti-pattern in two figures. It is not a hypothetical about very large deployments; it is the default state of any agent wired to a handful of MCP servers, because each server contributes its entire surface whether you wanted it or not.

The signature is easy to spot and nobody looks for it: count the tokens your tool definitions occupy, then divide by the tokens a typical task actually needs. If the ratio is worse than about 1:10 you are not running an agent with tools, you are running a catalog with an agent attached. Two other tells travel with it — the model picking a plausible neighbour of the right tool, and accuracy that improves when you delete tools rather than when you improve them.

The fixes are all forms of not showing the model the list:

  • Search instead of enumerate. Load one discovery tool and fetch definitions on demand. This is the 134K-to-500 move, and it is the cheapest of the three because it is a configuration change rather than a redesign.
  • Scope the catalog to the task. If the run is "triage this ticket", the deploy tools do not need to exist for the duration. Per-task scoping also happens to be the security control you wanted anyway, which is rare enough to be worth noticing.
  • Let the model write code against the tools rather than calling them one at a time — see STEP 6, because this one changes the first four anti-patterns too.

And resist the fix that looks cheapest: deleting tools until the model copes. That trades capability for selection accuracy, which is a real trade but a bad default, because it is irreversible in the only direction that matters — the tool you removed is the one next quarter's task needed.

Step 6Check each anti-pattern against the convention you are actually using — and measure the fix on your own traces.

The four signatures in STEP 1–STEP 4 all assume one convention: the model emits a JSON object naming one tool, per turn, chosen from a flat list. That assumption is no longer safe. "The Bitter Lesson of Tool Calling" (arXiv 2608.06370) evaluated 14 models on a 309-entry subset of BFCL v4 and reports that programmatic tool calling — the model writing code that invokes your tools — matches or exceeds native JSON tool calling in 11 of the 14, with the GPT-5.6 family gaining 10.6% over the JSON baseline.

Re-read the four under that convention and two of them change weight. Pagination cursors and internal join keys are far less leaky to code than to prose, because code can loop and filter; a kitchen-sink tool with a mode flag, on the other hand, is worse, because the model now has to get the mode right without the per-call schema pressure a direct tool call applies. The lesson is not "programmatic calling fixes tool design". It is that an anti-pattern is a claim about how a specific reader will misread a specific interface, so changing the reader re-ranks the list. Decide which of your tools is direct-called and which is code-called, then audit each group against its own convention.

Last, be careful how you prove the fix landed. A validity audit of tool-calling evaluation (arXiv 2607.02577) had experts review 496 tasks drawn from BFCL v4, τ²-Bench, LiveMCPBench and MCP-Atlas and found 92 evaluator–human disagreements — an 18.5% misalignment rate. Nearly one task in five is scored in a way a human expert would dispute, and BFCL v3 and v4 are not cross-comparable suites either. So a leaderboard delta is not evidence that your schema change worked. Your own recorded traces, replayed before and after, are — and the failure signatures named above are what you are counting.

None of this makes the four laws. A throwaway internal tool used once by a fixed harness can be stringly-typed and leaky and it does not matter. A genuinely general escape hatch — a sandboxed run_code — is a deliberate, contained leaky abstraction whose power is the point. The anti-pattern is shipping these by accident on a model-facing, freely chosen, side-effecting tool.

Run the audit in this order, because it is cheapest-first and each step shrinks the next: (1) count the tokens your tool definitions occupy and compare against a typical task's working set — if the ratio is worse than 1:10, fix the catalog before touching a single schema; (2) grep for plain string parameters with no enum, format or pattern; (3) grep your tool implementations for except blocks that return a success-shaped value; (4) list every tool with an action-style mode flag. Then verify on replayed traces, not on a benchmark.