{"record":{"id":"493696f1888c0038","repo":"paperclipai/paperclip","slug":"run-company-mismatch","errorCode":"run_company_mismatch","errorMessage":"Run does not belong to company","messagePattern":"Run does not belong to company","errorType":"http","errorClass":"ToolGatewayHttpError","httpStatus":403,"severity":"error","filePath":"server/src/services/tool-gateway.ts","lineNumber":1081,"sourceCode":"        applicationKey,\n        applicationDisplayName: application.name,\n        connectionId: connection.id,\n        catalogEntryId: catalogEntry.id,\n        transport: connection.transport,\n        gatewayToolName,\n        upstreamToolName: catalogEntry.toolName,\n        catalogName: catalogEntry.name,\n        inputSchema,\n        outputSchema,\n        annotations,\n        risk: {\n          level: catalogEntry.riskLevel,\n          isReadOnly: catalogEntry.isReadOnly,\n          isWrite: catalogEntry.isWrite,\n          isDestructive: catalogEntry.isDestructive,\n        },\n        onDemandTools,\n      };\n      return {\n        name: gatewayToolName,\n        displayName: catalogEntry.title ?? catalogEntry.toolName,\n        description: catalogEntry.description ?? `Connected MCP tool ${catalogEntry.toolName} from ${connection.name}.`,\n        parametersSchema: inputSchema,\n        pluginId: `mcp:${applicationKey ?? application.id}`,\n        providerType: connection.transport === \"local_stdio\" ? \"mcp_local_stdio\" : \"mcp_remote_http\",\n        risk,\n        applicationId: application.id,\n        applicationKey,\n        applicationDisplayName: application.name,\n        connectionId: connection.id,\n        catalogEntryId: catalogEntry.id,\n        upstreamToolName: catalogEntry.toolName,\n        providerMetadata,\n      };\n    });\n  }","sourceCodeStart":1063,"sourceCodeEnd":1099,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-gateway.ts#L1063-L1099","documentation":"Tenant guard on run resolution: the heartbeatRuns row for runId is missing or its companyId differs from the caller's company. Enforces company scoping for run-context lookups; the foreign runId is at fault.","triggerScenarios":"Thrown at server/src/services/tool-gateway.ts:1063 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a run ID that belongs to the authenticated company; cross-company run access is rejected."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}