ComposioHQ/composio · error · Error

Failed to execute local tool ${context.finalSlug}: ${toError

Error message

Failed to execute local tool ${context.finalSlug}: ${toErrorMessage(error)}

What it means

A catch-all wrapper around every local tool execution path (command, MCP, FFI). Any underlying error — argument failures, spawn errors, non-zero exits, FFI load failures — is rethrown with the tool slug prefixed and the original error attached as cause. Seeing this error means looking at the message suffix (and cause) for the real failure.

Source

Thrown at ts/packages/cli-local-tools/src/runtime.ts:290

export const executeLocalTool = async (
  execution: LocalToolExecution,
  input: Record<string, unknown>,
  context: LocalExecutionContext
): Promise<LocalExecutionResult> => {
  try {
    if (execution.kind === 'native') {
      return await execution.execute(input, context);
    }
    if (execution.kind === 'command') {
      return await runLocalCommand(execution, input, context);
    }
    if (execution.kind === 'mcp') {
      return await runLocalMcpTool(execution, input);
    }
    return await runLocalFfiTool(execution, input, context);
  } catch (error) {
    throw new Error(`Failed to execute local tool ${context.finalSlug}: ${toErrorMessage(error)}`, {
      cause: error,
    });
  }
};

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Inspect the message suffix and error.cause for the root error
  2. Fix the underlying cause (missing binary, permissions, bad args)
  3. Catch this error and log error.cause for actionable diagnostics
Defensive patterns

Strategy: try-catch

Try / catch

try { await executeLocalTool(slug, args, ctx); } catch (e) { const root = (e as Error & { cause?: unknown }).cause ?? e; console.error(root); }

Prevention

When it happens

Trigger: Any exception thrown inside runLocalCommandTool/runLocalMcpTool/runLocalFfiTool during executeLocalTool; the cause chain contains errors 242–245 or spawn errors like ENOENT.

Common situations: Generic failure surfacing when a local tool breaks for any reason; often wraps ENOENT when the command binary is not on PATH.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/0d71a7a1cad517bd. Report an issue: GitHub.