paperclipai/paperclip · error · ToolGatewayHttpError
err.message
Error message
err.message
What it means
Not a literal throw message: stopSlot catches a ToolRuntimeSupervisorError and re-surfaces it as a gateway HTTP error; the referenced field err.message is the supervisor error text (slot not found, wrong runtime kind, capacity, etc.) carried through so callers see the underlying runtime-slot failure reason.
Source
Thrown at server/src/services/tool-gateway.ts:6531
);
if (!tool) {
throw new ToolGatewayHttpError(404, `Tool "${input.toolName}" not found`, "tool_not_found", {
connectionId: input.connectionId,
tool: input.toolName,
});
}
const requestedParameters = await governedToolArguments(session, tool, input.parameters ?? {});
const argumentValidation = validateToolContent({
value: requestedParameters,
direction: "arguments",
sensitiveMode: "redact",
promptInjectionMode: "ignore",
});
const decisionInput = policyInputForAgentTool({
companyId: input.companyId,
agentId: input.agentId,
actorType: "user",
actorId: input.userId,
tool,
parameters: requestedParameters,
idempotencyKey: `test-call:${randomUUID()}`,
consumeRateLimit: true,
});
const accessDecision = await policyService.decide(decisionInput);
const recorded = await policyService.recordInvocation(decisionInput, accessDecision);
await policyService.writeAudit(decisionInput, accessDecision);
const invocationId = recorded.invocation.id;
if (accessDecision.decision === "require_approval") {
if (!recorded.actionRequest) {
throw new ToolGatewayHttpError(500, "Approval request was not created", "approval_request_missing", {
invocationId,
tool: tool.name,
});
}View on GitHub (pinned to 01ad858492)
Solutions
- The runtime supervisor rejected the operation with the wrapped message; follow that message (capacity, backoff, or unsupported runtime) and retry when conditions clear.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at server/src/services/tool-gateway.ts:6344 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/442aa8a3a855a3ef.
Report an issue: GitHub.