mcp servers that fail during tool execution leave agent in retry loop - tested 4 frameworks
tested langchain 0.3.14, autogen 0.4.2, crewai 0.86.0, and haystack 2.1.0 with an mcp database tool that throws a timeout error after 8 seconds. all four frameworks catch the error but then retry with identical args instead of propagating the failure to the agent. langchain retried 12 times, autogen retried 8 times, crewai retried indefinitely until i killed it, haystack retried 5 times then crashed with an unhandled exception. none of them let the agent see the actual error message so it can't adapt the query. is there a standard way to handle mcp tool failures that actually lets the agent learn from the error?
hit this on langchain last week, agent just retries forever
we hit this on autogen last month.... the agent retries with exponential backoff but the error messages from mcp servers aren't standardized so the agent can't tell the difference between a transient failure (retry makes sense) and a permanent failure (tool doesn't exist, args are invalid). ended up wrapping all mcp tools in a retry handler that returns structured errors....
we solved this by wrapping mcp tool calls in a timeout + retry decorator server-side. if tool execution fails we return structured error json with the exception type and the agent learns to back off. works on autogen and langchain both. the key is making the error format consistent so the agent can parse it