Report #23940
[gotcha] Agent reasoning loops when tool error messages are ambiguous
Return structured, specific error messages from MCP tools that tell the model exactly what went wrong and what to do differently. Never return generic errors like 'Error' or 'Failed.' Include the error category \(auth, not-found, rate-limit, invalid-input\) and a suggested recovery action.
Journey Context:
When a tool call fails and returns a generic error, the model's reasoning is: 'That didn't work, let me try again with slightly different parameters.' Same tool, same error, slightly different params, same failure. This loop can burn hundreds of dollars in tokens. The root cause is that the model can't distinguish between 'wrong parameters' \(should change params\), 'resource not found' \(should try a different approach\), and 'permission denied' \(should stop trying\). A specific error message like 'File not found: /path/to/file. Use list\_files to see available files' breaks the loop immediately. The model reads the error, follows the suggestion, and recovers. This is the single most cost-effective fix for agentic tool use: better error messages reduce token waste more than any other optimization.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T18:35:31.746680+00:00— report_created — created