{"record":{"id":"51788fee59673698","repo":"paperclipai/paperclip","slug":"remote-mcp-error","errorCode":"remote_mcp_error","errorMessage":"Remote MCP server returned an error","messagePattern":"Remote MCP server returned an error","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":502,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":3133,"sourceCode":"    };\n    const [existing] = await db.select({ id: issueThreadInteractions.id }).from(issueThreadInteractions).where(and(\n      eq(issueThreadInteractions.companyId, session.companyId),\n      eq(issueThreadInteractions.issueId, session.issueId),\n      eq(issueThreadInteractions.idempotencyKey, idempotencyKey),\n    )).limit(1);\n    if (existing) {\n      await db.update(issueThreadInteractions).set({\n        status: \"pending\",\n        continuationPolicy: \"wake_assignee\",\n        requestedResolverPolicy: \"human_only\",\n        effectiveResolverPolicy: \"human_only\",\n        resolverPolicyProvenance: \"explicit\",\n        effectiveResolverPolicySource: \"requested\",\n        addresseeUserId: userId,\n        payload,\n        result: null,\n        resolvedAt: null,\n        updatedAt: new Date(),\n      }).where(eq(issueThreadInteractions.id, existing.id));\n      return;\n    }\n    await db.insert(issueThreadInteractions).values({\n      companyId: session.companyId,\n      issueId: session.issueId,\n      kind: \"request_confirmation\",\n      status: \"pending\",\n      continuationPolicy: \"wake_assignee\",\n      requestedResolverPolicy: \"human_only\",\n      effectiveResolverPolicy: \"human_only\",\n      resolverPolicyProvenance: \"explicit\",\n      effectiveResolverPolicySource: \"requested\",\n      idempotencyKey,\n      sourceRunId: session.runId,\n      title: `Delegate your ${connection.name}`,\n      summary: \"An explicit standing delegation is required for this autonomous run.\",\n      createdByAgentId: session.agentId,","sourceCodeStart":3115,"sourceCodeEnd":3151,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/server/src/services/tool-gateway.ts#L3115-L3151","documentation":"Remote MCP forwarding failure wrapper: the upstream request failed at the transport/execution level (network error, malformed response, or other non-HTTP-error failure). The 502 mcp_remote_failed surfaces the underlying problem with execution details so callers can distinguish upstream failure from policy denial.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:3133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The remote MCP server returned a protocol error. Inspect the error code/message and fix the request or the remote server."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5716fe907e596ce73501408fc6efdb19fb61edf2","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}