The Research Report
Tool Use Prompting Patterns: Five Failure Modes and the Prompts That Fix Them
Why your agent keeps calling the wrong tool, and how to stop it.
Every frontier model in 2026 — Claude, GPT, Gemini — supports tool use. They can read files, search the web, query databases, and run code. The capability is there. The reliability is not.
Tool use fails in predictable ways. A model calls searchdocs when it should call readfile. It answers from memory when the weather has changed. It retries a broken API call seventeen times. These failures look like model bugs, but they are almost always prompt bugs.
SurePrompts published a comprehensive guide this month identifying five failure modes and the prompt-level fixes for each. This article unpacks that guide, adds context from real-world agent deployments, and gives you a checklist you can use today.
The Five Failure Modes
Here is the taxonomy. Every failed tool-use run I have debugged in the past year fits into one of these five buckets.
| Failure Mode | What It Looks Like | Root Cause |
|---|---|---|
| Wrong tool | Model calls search when it should call read_file |
Overlapping tool descriptions |
| No tool | Model answers from training data when it should look up current data | System prompt does not require tool use |
| Malformed arguments | JSON is invalid, required field missing, type wrong | Schema unclear, no examples |
| Infinite loop | Model keeps calling the same tool forever | No stop condition or retry cap |
| Hallucinated result | Tool returns nothing useful, model invents content anyway | No instruction for empty or error results |
Four of the five are prompt-level problems. A smarter model reduces the rate. It does not remove the failure mode. Only prompt patterns do that.
Failure Mode 1: Wrong Tool
The model has a toolbox of eight tools. Two of them mention "search" in their description. The user asks for a specific file. The model rolls the dice and picks the wrong search tool.
This is the most common failure I see in multi-tool agents. The fix is not adding more tools. It is sharpening the descriptions.
The Fix: Explicit Negatives
A good tool description has five parts:
- Name. Short, verb-like, distinctive.
search_docsbeatsdocs. - Purpose. One sentence on what it does, written from the model's perspective: "Use this when the user asks for..."
- Parameters. Named, typed, described. Required vs optional marked.
- Example use. One concrete sample argument set.
- What it does NOT do. An explicit negative. "Does not search the web. Use
web_searchfor that."
The negative is the part everyone skips, and it is often the most useful line in the entire prompt. When two tools sound plausible, the model picks essentially at random. An explicit "this is not that" forces the distinction.
Example
Bad:
search_docs: Searches documents for relevant content.
Good:
searchdocs: Searches the local documentation index for relevant sections. Use this when the user asks about API behavior, configuration options, or error messages. Does NOT search the web or read specific files. For web search, usewebsearch. For reading a known file path, useread_file.
The bad version tells the model nothing about when to prefer this tool over the other seven. The good version draws boundaries.
Failure Mode 2: No Tool
The user asks: "What is the weather in Chicago?" The model answers from its training data, which knows the weather as of its knowledge cutoff. It does not call the weather API. The answer is wrong.
This happens because the system prompt defaults to auto mode. The model decides whether to call a tool or answer directly. For questions where a stale answer is worse than a slow one, that guess is often wrong.
The Fix: Tool-Forcing
Most APIs expose three modes:
- Auto. The model decides. Default.
- Any / required. The model must call a tool, but picks which one.
- Specific tool. The model must call the named tool.
The prompt-level equivalents:
- Tool-permitting: "You may use these tools if helpful."
- Tool-forcing: "You must call one of these tools before responding."
- Phase-scoped forcing: "In the research phase, you must call
searchat least once. In the writing phase, do not call any tools."
Force a tool call when answering without it risks stale or invented data. This includes current events, user files, live databases, and external systems. Permit when the model might genuinely know the answer and a tool call would add latency without value. When in doubt, force. The cost of an unnecessary tool call is a few hundred milliseconds. The cost of a hallucinated answer is trust.
Failure Mode 3: Malformed Arguments
The model calls sendemail but passes the recipient in a field called to when the schema expects recipientemail. The call fails. The model tries again with recipient. Still wrong.
This happens when the parameter schema is unclear or lacks examples.
The Fix: Clear Schema and Examples
Every parameter needs:
- A name that matches the API exactly
- A type (string, number, boolean, array, object)
- A description of what goes in it
- An example value
- A note if it is required or optional
Example
Bad:
recipient: The person to send to.
Good:
recipient_email(string, required): The email address of the recipient. Must be a valid email format. Example:"[email protected]". Use"[email protected]"not just"user".
The model does not know your API conventions. It does not know that your backend validates email format. It needs the example to pattern-match against.
Failure Mode 4: Infinite Loop
The model calls a search tool. The search returns no results. The model calls it again with a slightly different query. Still no results. Again. Again. Until the harness kills the session after fifty turns.
Without guidance, the model treats every tool error as "try again with variation." It has no concept of giving up.
The Fix: Error Protocol
Add four lines to your system prompt:
If a tool returns an error or empty result, evaluate whether the issue is:
1. A fixable input problem (wrong parameters, typos)
2. A data problem (no results exist, access denied)
For fixable problems, retry once with corrected arguments. For data problems, stop and report the issue to the user. Never retry the same failed call more than once.
The retry cap matters. Without it, the model will keep retrying with tiny variations for as many turns as the harness allows.
Failure Mode 5: Hallucinated Result
The model calls a retrieval tool. The tool returns an empty result. The model, rather than reporting this, fabricates content that fits the user's query and cites the empty result as its source.
This is the most insidious failure mode because it looks like success. The model answered the question and cited a source. The source was empty.
The Fix: Result Evaluation Protocol
Force the model to evaluate results before using them:
After receiving tool results, evaluate whether they actually answer the user's question. If results are empty, irrelevant, or contradictory, state that clearly. Do not invent information to fill gaps. Always cite which tool call each claim came from.
The citation requirement is the quiet heavy-lifter. When the model has to cite which tool call produced each claim, it cannot smoothly merge tool output with hallucinated content. The citation exposes the gap.
Constraining Tool Use Deliberately
Reliability also comes from limiting tool use. Here are constraints worth applying:
Budget limits. "Use at most 5 tool calls for this task." Prevents drift on open-ended questions. The model learns to plan its calls rather than scatter them.
Phase-specific tools. "In the planning phase, only readfile and grep are allowed. In the implementation phase, editfile is added. In verification, only run_tests is allowed."
Order constraints. "You must call readfile on a file before calling editfile on it." Prevents blind edits.
Forbidden combinations. "Do not call deletefile in the same turn as createfile on the same path. If you need to rewrite a file, use edit_file." Stops destructive patterns.
These constraints are brittle. A stubborn model will sometimes break the rule. But they catch most violations and make the rest visible in traces.
A Complete Tool-Use System Prompt
Here is a hypothetical but realistic system prompt for a research agent. It incorporates every pattern discussed above.
You are a research agent with three tools: web_search, read_file, and grep_code.
web_search: Searches the live web for current information. Use this for questions
about current events, prices, weather, or anything time-sensitive. Does NOT read
local files or search codebases. Example query: {"query": "OpenAI API pricing 2026"}
read_file: Reads the full contents of a file at a given path. Use this when the
user references a specific file or when you need to see exact code or config.
Does NOT search the web or grep codebases. Example: {"path": "/project/config.json"}
grep_code: Searches the codebase for patterns across multiple files. Use this when
the user asks about code patterns, function definitions, or usage across the project.
Does NOT read full files or search the web. Example: {"pattern": "def authenticate",
"path": "/project/src"}
Rules:
1. You MUST call at least one tool before answering any factual question.
2. After receiving tool results, evaluate whether they answer the question. If empty
or irrelevant, state this clearly. Do not invent information.
3. Cite which tool call each claim in your answer came from.
4. If a tool returns an error, determine if it is fixable. Retry once if fixable.
Otherwise stop and report the issue. Never retry more than once.
5. Use at most 5 tool calls per task.
6. When done, call finish({"status": "complete"}) and then reply to the user.
This prompt is under 250 words. Each line corresponds to a failure mode you would otherwise debug in production.
Common Anti-Patterns
Here are the mistakes I see most often:
Vague descriptions. "This tool searches things." The model cannot tell it apart from other tools. Fix: specify purpose, example, and what it does NOT do.
Too many tools. A 40-tool toolbox overwhelms selection accuracy, which degrades past 10–15 tools. Fix: group by phase and expose only phase-relevant subsets.
No stop condition. No finish tool, no budget, no "when done, reply to the user." The model loops. Fix: always define an explicit terminator.
Trusting every result. No instruction to evaluate results before using them. The model merges garbage into its answer. Fix: require citation and evaluation.
Single-mode thinking. Setting everything to auto regardless of whether the question needs fresh data. Fix: use tool-forcing for time-sensitive questions.
Ignoring errors. No error protocol, so the model retries the same broken call until it runs out of turns. Fix: the four-line error protocol above.
When Things Get Complex
These patterns compose with broader agent architectures. For agents that loop over tool calls with reasoning in between, combine these patterns with ReAct prompting. For multi-agent systems, tool descriptions and protocols become part of what each agent sees.
If two tools return conflicting information, instruct the model to surface the contradiction rather than pick. "State both findings and explain which appears more authoritative, or ask the user to resolve it." Hiding contradictions to produce a clean answer is a worse failure than flagging them.
Debugging a Failed Tool-Use Run
When a run goes sideways, read the trace turn by turn:
- Which tool was called?
- What arguments were passed?
- What did it return?
- What did the model say next?
Most bugs are visible in one specific transition. A result comes back, and the next turn ignores it. From there, the fix is usually a prompt-level instruction about how to handle that case.
The Bottom Line
Tool use works across every frontier model in 2026. Reliable tool use comes from the prompt.
Good descriptions with explicit negatives stop wrong-tool errors. Tool-forcing stops stale-answer errors. Error and result protocols stop silent failures. Budget and phase constraints stop drift.
The whole set fits in a system prompt under 300 words. Each line corresponds to a failure mode you would otherwise debug in production at 2 AM.
Write the prompt once. Save yourself the debugging.
Sources: SurePrompts — "Tool Use Prompting Patterns: Getting Reliable Tool Calls (2026)"