Why AI Agents Fail at Tool Use (and How to Design Tools That Don't)

In short: AI agents mostly fail because of how their tools are built, not because the underlying model is too weak. Vague tool descriptions, overlapping tools, bloated responses, and opaque error messages are the most common root causes — and all four are fixable without touching the model.
What this means for you
- Diagnose tool-use failures in the tools themselves before reaching for a bigger model or a longer prompt.
- Consolidate overlapping tools into fewer, well-described ones instead of adding more.
- Add iteration caps, sandboxed evaluation, and human checkpoints before an agent reaches production, not after.
When an AI agent misbehaves — calling the wrong tool, looping, or passing malformed arguments — the instinctive fix is to swap in a bigger model or rewrite the system prompt. That usually isn't where the problem lives. Anthropic's own engineering guidance on building effective agents is blunt about this: agentic systems fail mainly through compounding errors and rising cost as the number of steps grows, and the fix is extensive testing in sandboxed environments, clear stopping conditions, and human checkpoints — not a model swap. A companion piece, writing tools for agents, goes further: tool quality is usually the first lever to pull, and small wording changes in a tool's description can have large effects on whether an agent calls it correctly.
Workflow or agent? Start with the simplest thing that works
Not every AI feature needs to be an autonomous agent looping on its own tool calls. Anthropic's building-effective-agents guidance lays out a small set of patterns, roughly in order of increasing complexity, and recommends adding complexity only when it clearly improves results:
- Augmented LLM — a single call enhanced with retrieval, tools, and memory. Often enough on its own.
- Prompt chaining — sequential steps with a programmatic check between them. Trades speed for accuracy.
- Routing — classify the input first, then send it to a specialized prompt, tool, or cheaper model for the easy cases.
- Parallelization — split independent subtasks across calls, or run the same task multiple times and vote on the result.
- Orchestrator-workers — a central LLM breaks a task down, delegates the pieces, and synthesizes the results.
- Evaluator-optimizer — one call generates, another critiques, in a loop. Works best with clear evaluation criteria.
- Autonomous agents — an LLM uses tools in a loop guided by feedback from its environment, for problems where the number of steps can't be predicted up front.
Reach for the last pattern only when the task is genuinely open-ended. Workflows are more predictable, cheaper to run, and far easier to debug than a full agentic loop — and most "agent" use cases people describe are actually a workflow in disguise.
Four ways tool design quietly breaks agents
1. Descriptions that leave questions open
Anthropic's tool-definition guidance contrasts two descriptions for the same tool. The weak version — "Gets the stock price for a ticker" — leaves the model guessing at what the tool actually returns and when to call it. The strong version states the exchange it covers, the currency it returns, when to use it, and explicitly what it won't tell you. The guidance recommends at least 3-4 sentences per tool description, more if the tool is complex, and reserving input_examples for schemas with nested objects or format-sensitive parameters.
2. Too many tools that overlap
Anthropic's writing-tools-for-agents guidance warns that overlapping tools distract agents from efficient strategies — the model has to spend reasoning effort deciding between two tools that do almost the same thing. The fix is consolidation: a single schedule_event tool that finds availability and books the event beats separate list_availability and create_event tools the agent has to chain itself. Namespacing tool names by service (github_list_prs, slack_send_message) keeps a growing tool library unambiguous.
3. Responses that bury the signal
A tool that dumps a full record — internal IDs, timestamps, every field in the row — forces the model to spend context figuring out what matters. The same guidance recommends returning high-signal fields (names, stable slugs) instead of opaque identifiers, and preferring a targeted tool like search_logs, which returns only the relevant lines with context, over a read_logs tool that returns everything.
4. Errors that don't tell the model what to fix
An agent can self-correct from a tool_result that says what went wrong and how to fix it. It can't self-correct from a bare error code or a raw stack trace — it will usually just retry the same malformed call.
Designing tools that hold up in production
Put together, Anthropic's tool-use documentation and engineering guidance point to a short, concrete checklist:
- Write descriptions like onboarding a new hire — what the tool does, when to use it, when not to, and what each parameter means.
- Consolidate related actions into one tool with a parameter instead of one tool per API endpoint.
- Use unambiguous parameter names (
user_id, notuser) and strict types. - Turn on strict tool use for anything that feeds a downstream system. Setting
strict: trueconstrains the model's token sampling to schema-valid output, so a passenger-count field can't come back as"two"or"2"when your code expects the integer2— it guarantees type-safe arguments instead of making you validate and retry after the fact. - Return only what the next step needs. Paginate, filter, and truncate large responses, and steer the model toward a narrower query instead of dumping everything.
Guardrails that catch what good tool design can't
Even well-designed tools don't make an agent infallible, so the building-effective-agents guidance pairs tool quality with explicit guardrails before anything reaches production:
- Sandboxed evaluation against realistic, multi-step tasks — not a toy scenario, and not graded only on the final answer. Anthropic's own process tracks accuracy alongside tool call counts, token use, and error rate, and reads full transcripts, since what an agent leaves out of its reasoning can matter as much as what it says.
- A maximum iteration count, so a confused agent fails loudly instead of looping indefinitely and running up cost.
- Human checkpoints at the steps where a wrong call is expensive to undo.
- Clear, verifiable success criteria for each step — automated tests for code, a schema check for structured data — rather than trusting the agent's own account of whether it succeeded.
None of this is specific to one model or vendor. If you're building an agent that calls tools against your own systems — a CRM, an internal API, a billing platform — the discipline is the same regardless of which model sits behind it: design the tools first, evaluate them against real workflows, then decide how much autonomy the agent actually needs. That evaluation step is also where you catch the model-choice and prompt problems people usually blame first — see our guide to LLM evaluation for how to structure it. If you're weighing a managed protocol against hand-rolled tool integrations for that same agent, we cover the trade-off in MCP vs. custom API integration.
This is also exactly where our AI integration work starts: proving tool reliability against real workflows in a sandboxed evaluation before an agent is allowed to touch production data, rather than discovering the failure modes after launch.
Frequently asked questions
Why do AI agents fail in production?
Most production failures trace to the tools and the operating environment, not the model: vague tool descriptions, overlapping tools that confuse tool selection, bloated or low-signal responses, and error messages that don't tell the model what to fix. Anthropic's own agent-building guidance points to compounding errors and rising cost as step count grows, and recommends fixing tool design and adding guardrails before assuming the model itself is the problem.
What makes a good tool description for an AI agent?
A description that states what the tool does, when it should (and shouldn't) be used, what each parameter means, and any caveats or limitations — written the way you'd brief a new hire. Anthropic's documentation recommends at least 3-4 sentences per tool, and using the input_examples field for tools with complex, nested, or format-sensitive parameters.
Should an AI agent have many narrow tools or a few broad ones?
Fewer, well-chosen tools that each do more. Anthropic's guidance on writing tools for agents recommends consolidating chained steps into a single tool (a schedule_event tool that finds availability and books it, instead of separate list and create tools) and warns that overlapping tools distract agents into inefficient strategies.
How do you stop an AI agent from looping or going off the rails?
Guardrails set before the agent reaches production: a maximum iteration count so a confused agent fails loudly instead of running indefinitely, sandboxed evaluation against realistic multi-step tasks with verifiable outcomes, and human checkpoints at steps where a wrong call is expensive to undo.
Should I build an autonomous agent or a simpler workflow?
Use the simplest pattern that works. Anthropic's building-effective-agents guidance lists prompt chaining, routing, parallelization, orchestrator-workers, and evaluator-optimizer as workflow patterns that are more predictable and easier to debug than a full autonomous agent. Reach for an autonomous agent — an LLM using tools in a loop — only when the task is genuinely open-ended and the number of steps can't be predicted in advance.
Sources
- Building Effective Agents — Anthropic Engineering — Workflow vs. agent patterns (prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer, autonomous agents), and why agents fail (compounding errors, cost) plus the guardrails (sandboxed testing, stopping conditions, human checkpoints).
- Writing Tools for Agents — Anthropic Engineering — Tool consolidation, namespacing, response shaping (high-signal fields over raw IDs), targeted vs. dump-everything tools, and evaluation methodology (realistic multi-step tasks, transcript review).
- Define Tools — Claude Platform Docs — Tool description best practices (detail, examples via input_examples) and the good-vs-poor description comparison.
- Strict Tool Use — Claude Platform Docs — What strict: true guarantees (schema-valid, type-safe tool inputs via grammar-constrained sampling) and the passenger-count type-mismatch example.
Need help putting this into practice?
Tech Programmer builds and ships this work for startups and enterprises. Tell us what you are trying to do and we will tell you what it takes.
Related reading
- LLM API Cost Optimization: How to Cut Your AI Bill Without Hurting QualityMost teams' AI bills grow faster than their AI feature does, usually because nobody instrumented cost per operation before adding more calls. Prompt caching, batch processing, output control, and model routing are the four levers that actually move the number, roughly in order of effort-to-payoff. Here is what each one saves, sourced from provider pricing pages rather than vendor benchmark claims, and the mistakes that erase the savings before you see them.
- Vector Database vs. pgvector: Do You Actually Need a Dedicated One?Most teams adding semantic search reach for a dedicated vector database before checking whether the Postgres instance they already run can do the job. pgvector is a Postgres extension, not a new service: it adds a vector column type and an HNSW index to a database you're already operating. It stays comfortable for most teams under roughly 10 million vectors. A dedicated store like Qdrant, Weaviate, or Pinecone earns its place once your corpus genuinely outgrows that, hybrid search or multi-tenant isolation is core to the product rather than a nice-to-have, or you want a vendor to own the ops instead of you.
- Structured Output vs Free Text: When Should an LLM Return JSON?Free text is the right model output when a person reads the answer. A JSON schema is the right output when your code must parse fields and pass them to a UI, a database, or another API. JSON mode only promises that the text parses as JSON. Structured outputs go further and constrain the model to a schema. Neither one makes the values true. Check refusals and truncated responses, then test the fields the way you test any other AI feature.