{"record":{"id":"20d15a25eea8ae45","repo":"paperclipai/paperclip","slug":"tool-timeout","errorCode":"tool_timeout","errorMessage":"Remote MCP tool call timed out","messagePattern":"Remote MCP tool call timed out","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":504,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":3159,"sourceCode":"      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,\n      addresseeUserId: userId,\n      payload,\n    });\n  }\n\n  async function resolveConnectionGrant(\n    session: ToolGatewaySession,\n    connection: typeof toolConnections.$inferSelect,\n  ): Promise<typeof connectionGrants.$inferSelect> {\n    const [run] = session.runId\n      ? await db.select({\n          responsibleUserId: heartbeatRuns.responsibleUserId,\n          invocationSource: heartbeatRuns.invocationSource,\n        }).from(heartbeatRuns).where(and(\n          eq(heartbeatRuns.id, session.runId),\n          eq(heartbeatRuns.companyId, session.companyId),\n        )).limit(1)\n      : [];\n    const actingUserId = run?.responsibleUserId ?? session.responsibleUserId ?? null;\n    const autonomous = run?.invocationSource === \"automation\" || run?.invocationSource === \"timer\";\n    const findUserGrant = async () => {\n      if (!actingUserId) return undefined;\n      const [membership] = await db.select({ id: companyMemberships.id }).from(companyMemberships).where(and(\n        eq(companyMemberships.companyId, connection.companyId),\n        eq(companyMemberships.principalType, \"user\"),\n        eq(companyMemberships.principalId, actingUserId),","sourceCodeStart":3141,"sourceCodeEnd":3177,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/server/src/services/tool-gateway.ts#L3141-L3177","documentation":"The remote MCP tools/call fetch aborted via AbortError, meaning the upstream server exceeded the configured timeout. Connection health is marked error and a 504/gateway-timeout style failure is returned; the call itself may or may not have executed remotely, so blind retry of non-idempotent tools is unsafe.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:3159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The remote MCP call timed out. Retry, increase the timeout if configurable, or check the remote server's latency/load."],"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-14T00:17:10.932Z"}