paperclipai/paperclip · error · ToolGatewayHttpError
gateway_not_found
gateway_not_found
Error message
MCP gateway not found
What it means
getGatewayWithTokens found no toolMcpGateways row for the given gatewayId within the company. The 404 fires on the company-scoped lookup, so it also covers cross-company access attempts; the gateway was deleted or the id is wrong.
Source
Thrown at server/src/services/tool-gateway.ts:3481
const currentParameters = await governedToolArguments(session, tool, reviewedParameters);
return stableSerialize(currentParameters) === stableSerialize(reviewedParameters);
}
async function resolveConnectedLocalStdioTool(session: ToolGatewaySession, tool: ToolGatewayDescriptor) {
if (tool.providerType !== "mcp_local_stdio" || !tool.connectionId || !tool.catalogEntryId) {
throw new ToolGatewayHttpError(404, `Tool "${tool.name}" not found`, "tool_not_found");
}
const [entry] = await db
.select()
.from(toolCatalogEntries)
.where(and(
eq(toolCatalogEntries.id, tool.catalogEntryId),
eq(toolCatalogEntries.companyId, session.companyId),
))
.limit(1);
if (!entry || entry.status !== "active" || entry.entryKind !== "tool") {
throw new ToolGatewayHttpError(404, `Tool "${tool.name}" not found`, "tool_not_found");
}
const [connection] = await db
.select()
.from(toolConnections)
.where(and(
eq(toolConnections.id, entry.connectionId),
eq(toolConnections.companyId, session.companyId),
))
.limit(1);
if (!connection || connection.transport !== "local_stdio") {
throw new ToolGatewayHttpError(404, `Tool "${tool.name}" not found`, "tool_not_found");
}
if (!connection.enabled || connection.status !== "active") {
throw new ToolGatewayHttpError(403, "Connection is disabled.", "local_stdio_connection_disabled", {
connectionId: connection.id,
});
}
return { entry, connection };
}View on GitHub (pinned to 01ad858492)
Solutions
- Verify the MCP gateway ID exists for this company; list gateways and use a valid one.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/src/services/tool-gateway.ts:3340 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18).
Data as JSON: /api/errors/064f1de3e35cc930.
Report an issue: GitHub.