paperclipai/paperclip · error · ToolGatewayHttpError
tool_execution_failed
tool_execution_failed
Error message
Approved tool action failed
What it means
Reported when an approved tool action finished with status failed and no invocation errorMessage was stored: the gateway returns the settled invocation's error text, falling back to this generic 'Approved tool action failed' 502. It means execution was attempted after approval and the tool itself errored; inspect the invocation/events for the root cause.
Source
Thrown at server/src/services/tool-gateway.ts:4311
// onto a loopback or metadata address between validation and dispatch
// (PAP-17098).
const requestInit: RequestInit = {
method: "POST",
redirect: "manual",
// MCP Streamable HTTP requires the Accept header advertising both a JSON
// body and an SSE stream; spec-compliant servers 406 without it.
headers: mcpHttpRequestHeaders(requestHeaders),
signal: controller.signal,
body: JSON.stringify({
jsonrpc: "2.0",
id: requestId,
method: "tools/call",
params: {
name: entry.toolName,
arguments: parameters,
},
}),
};
let response = await dispatchRemote(endpoint, requestInit);
if (response.status === 401 && composioChild) {
composioSession = await composioSessions.ensureSession(connection.id, {
tools: [entry.toolName],
scopeRevision: composioScopeRevision,
force: true,
});
endpoint = composioSession.url;
credentialHeaders = composioSession.headers;
builtHeaders = buildRemoteHeaders({ session, connection, credentialHeaders, callerHeaders });
headers = builtHeaders.headers;
headerSummary = builtHeaders.summary;
const retryInit = { ...requestInit, headers: mcpHttpRequestHeaders(headers) };
response = await dispatchRemote(endpoint, retryInit);
}
const oauth = asRecord(asRecord(connection.config)?.oauth);
if (
response.status === 401View on GitHub (pinned to 01ad858492)
Solutions
- The approved action failed during execution. Inspect the execution error details and fix the underlying tool/input problem before retrying with a new approval.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at server/src/services/tool-gateway.ts:4170 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/31c41c16ea73ced9.
Report an issue: GitHub.