{"record":{"id":"9b85b5ca2bf8d650","repo":"paperclipai/paperclip","slug":"mcp-remote-fetch-failed","errorCode":"mcp_remote_fetch_failed","errorMessage":"Remote MCP tool call failed","messagePattern":"Remote MCP tool call failed","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":502,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":6156,"sourceCode":"          \"Remote MCP tool call timed out.\",\n        );\n        throw new ToolGatewayHttpError(\n          504,\n          \"Remote MCP tool call timed out\",\n          \"tool_timeout\",\n          {\n            connectionId: connection.id,\n            catalogEntryId: entry.id,\n            execution,\n          },\n        );\n      }\n      await markRemoteConnectionHealth(\n        connection,\n        \"error\",\n        \"Remote MCP tool call failed.\",\n      );\n      throw new ToolGatewayHttpError(\n        502,\n        \"Remote MCP tool call failed\",\n        \"mcp_remote_fetch_failed\",\n        {\n          connectionId: connection.id,\n          catalogEntryId: entry.id,\n          execution,\n        },\n      );\n    } finally {\n      clearTimeout(timer);\n    }\n  }\n\n  async function executeLocalStdioTool(\n    session: ToolGatewaySession,\n    tool: ToolGatewayDescriptor,\n    parameters: unknown,","sourceCodeStart":6138,"sourceCodeEnd":6174,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/server/src/services/tool-gateway.ts#L6138-L6174","documentation":"Catch-all in the remote MCP call path: the fetch or response handling threw a non-ToolGatewayHttpError, non-timeout exception (DNS failure, socket reset, unexpected parser crash). Connection health is marked error and the error propagates as a gateway 502 with execution details attached for diagnosis.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:3166 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The remote MCP call failed at the transport level. Check network connectivity and remote server status, then retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}