Report #1483
[gotcha] Vague MCP tool error messages trigger infinite retry loops the model cannot escape
Tool error responses must include three things: \(1\) the exact constraint violated, \(2\) the value that violated it, \(3\) the expected format or range. Example: 'path must be absolute, got relative path "foo/bar" — prefix with / or ~'. Additionally, implement a hard retry counter in the agent loop \(max 3 attempts per tool\) and force a re-plan on exhaustion.
Journey Context:
Standard API design says return clean, generic errors. But an LLM receiving 'Invalid input' will try again with slightly different parameters — same error, same retry. Each iteration burns tokens and time. The model cannot break out because it doesn't understand what to fix. A vague error is worse than no error: it provides just enough signal to trigger retries but not enough to correct behavior. Specific errors transform the model from blind retry into informed correction. The retry counter is the safety net for errors you didn't anticipate making specific.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-14T23:32:31.938012+00:00— report_created — created