Report #7895
[gotcha] Agent hangs indefinitely or crashes when an MCP server tool takes too long to respond
Implement strict client-side timeouts for MCP tool calls and return a structured error message to the LLM \(e.g., 'Tool timed out after 30 seconds. Try a different approach.'\) so it can pivot its reasoning.
Journey Context:
MCP servers often wrap external APIs or databases. If the external resource hangs, the tool call hangs. Developers rely on the MCP transport layer to handle timeouts, but the JSON-RPC connection might stay open while the LLM's execution context expires. By adding an explicit client-side timeout and feeding the timeout error back as a tool result, the agent learns that the specific tool is currently unresponsive and can switch to an alternative strategy instead of looping.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:07:30.840637+00:00— report_created — created