paperclipai/paperclip · error · ToolGatewayHttpError

message

Error message

message

What it means

Not a literal throw message: this is the audit details block for tool_gateway.call_failed / call_deferred. The referenced field is the normalized error 'message' variable — the upstream/tool error text captured after a failed or deferred tool call, recorded with invocationId, reasonCode, durationMs, and execution audit metadata for diagnosis.

Source

Thrown at server/src/services/tool-gateway.ts:6204

        .where(and(eq(toolMcpGateways.companyId, input.companyId), eq(toolMcpGateways.id, input.gatewayId)))
        .limit(1);
      if (!existing) throw new ToolGatewayHttpError(404, "MCP gateway not found", "gateway_not_found");
      await assertGatewayContext({
        companyId: input.companyId,
        profileId: input.body.profileId ?? existing.profileId,
        agentId: input.body.agentId === undefined ? existing.agentId : input.body.agentId,
        projectId: input.body.projectId === undefined ? existing.projectId : input.body.projectId,
        issueId: input.body.issueId === undefined ? existing.issueId : input.body.issueId,
      });
      const [updated] = await db
        .update(toolMcpGateways)
        .set({
          ...(input.body.name !== undefined ? { name: input.body.name } : {}),
          ...(input.body.slug !== undefined || input.body.displaySlug !== undefined ? { slug: input.body.displaySlug ?? input.body.slug } : {}),
          ...(input.body.slug !== undefined || input.body.displaySlug !== undefined ? { displaySlug: input.body.displaySlug ?? input.body.slug } : {}),
          ...(input.body.description !== undefined ? { description: input.body.description ?? null } : {}),
          ...(input.body.status !== undefined ? { status: input.body.status } : {}),
          ...(input.body.profileId !== undefined ? { profileId: input.body.profileId } : {}),
          ...(input.body.defaultProfileMode !== undefined ? { defaultProfileMode: input.body.defaultProfileMode } : {}),
          ...(input.body.contextScopeType !== undefined ? { contextScopeType: input.body.contextScopeType } : {}),
          ...(input.body.contextScopeId !== undefined ? { contextScopeId: input.body.contextScopeId ?? null } : {}),
          ...(input.body.agentId !== undefined ? { agentId: input.body.agentId ?? null } : {}),
          ...(input.body.projectId !== undefined ? { projectId: input.body.projectId ?? null } : {}),
          ...(input.body.issueId !== undefined ? { issueId: input.body.issueId ?? null } : {}),
          ...(input.body.approvalIssueId !== undefined ? { approvalIssueId: input.body.approvalIssueId ?? null } : {}),
          ...(input.body.authConfig !== undefined ? { authConfig: input.body.authConfig } : {}),
          ...(input.body.headerPolicy !== undefined ? { headerPolicy: input.body.headerPolicy } : {}),
          ...(input.body.metadataPolicy !== undefined ? { metadataPolicy: input.body.metadataPolicy } : {}),
          ...(input.body.onDemandToolsConfig !== undefined ? { onDemandToolsConfig: input.body.onDemandToolsConfig } : {}),
          ...(input.body.metadata !== undefined ? { metadata: input.body.metadata ?? {} } : {}),
          updatedAt: new Date(),
        })
        .where(and(eq(toolMcpGateways.companyId, input.companyId), eq(toolMcpGateways.id, input.gatewayId)))
        .returning();
      if (input.body.profileId && input.body.profileId !== existing.profileId) {
        await db

View on GitHub (pinned to 01ad858492)

Solutions

  1. The tool call failed with the wrapped error message; address the reported cause (often a validation or provider error) and retry.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at server/src/services/tool-gateway.ts:6017 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/a9593674469a65cb. Report an issue: GitHub.