{"record":{"id":"ce936fd23f117e1d","repo":"BerriAI/litellm","slug":"mcp-tool-call-timed-out-after-timeout-s","errorCode":null,"errorMessage":"MCP tool call timed out after {_timeout}s","messagePattern":"MCP tool call timed out after (.+?)s","errorType":"http","errorClass":"HTTPException","httpStatus":504,"severity":"error","filePath":"litellm/proxy/_experimental/mcp_server/mcp_server_manager.py","lineNumber":5074,"sourceCode":"                                type(e).__name__,\n                            )\n                            return client.error_tool_result(e)\n                        _, www_authenticate = auth_info\n                        raise MCPUpstreamAuthError(\n                            status_code=401,\n                            www_authenticate=www_authenticate,\n                            server_name=server_label,\n                        ) from e\n\n            tool_call_coro = _call_tool_via_client(client, call_tool_params)\n\n        tasks.append(asyncio.create_task(tool_call_coro))\n\n        _timeout: Final = mcp_server.timeout if mcp_server.timeout is not None else MCP_CLIENT_TIMEOUT\n        try:\n            mcp_responses: Final = await asyncio.wait_for(asyncio.gather(*tasks), timeout=_timeout)\n        except asyncio.TimeoutError:\n            raise HTTPException(\n                status_code=504,\n                detail={\n                    \"error\": \"timeout\",\n                    \"message\": f\"MCP tool call timed out after {_timeout}s\",\n                },\n            )\n        except (\n            BlockedPiiEntityError,\n            GuardrailRaisedException,\n            HTTPException,\n        ) as e:\n            verbose_logger.error(\"Guardrail blocked MCP tool call during result check: %s\", e)\n            raise e\n\n        # If proxy_logging_obj is None, the tool call result is at index 0\n        # If proxy_logging_obj is not None, the tool call result is at index 1 (after the during hook task)\n        result_index: Final = 1 if proxy_logging_obj else 0\n        result: Final = mcp_responses[result_index]","sourceCodeStart":5056,"sourceCodeEnd":5092,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/_experimental/mcp_server/mcp_server_manager.py#L5056-L5092","documentation":"The MCP tool call task did not finish within the configured timeout, so the awaiting side raises this HTTPException instead of blocking indefinitely. The upstream call is abandoned; no partial result is returned.","triggerScenarios":"Thrown at litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:5074 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase the MCP tool timeout, or investigate why the tool is slow."],"exampleFix":"Raise timeout in config; check upstream tool latency.","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}