FlowiseAI/Flowise · error · Error

Error executing tool. Tool: ${tool.name}. Thread ID: ${threa

Error message

Error executing tool. Tool: ${tool.name}. Thread ID: ${threadId}. Run ID: ${runThreadId}

What it means

During the assistant run loop, when a run reaches `requires_action`, the code executes each requested tool. If a tool's execution throws, onToolError fires, the error is console.error'd, and a generic 'Error executing tool' message is thrown — the original tool error `e` is NOT included in the message, only tool name, threadId, and runThreadId.

Source

Thrown at packages/components/nodes/agents/OpenAIAssistant/OpenAIAssistant.ts:587

                                    const toolOutput = await tool.call(actions[i].toolInput, undefined, undefined, {
                                        sessionId: threadId,
                                        chatId: options.chatId,
                                        input
                                    })
                                    await analyticHandlers.onToolEnd(toolIds, toolOutput)
                                    submitToolOutputs.push({
                                        tool_call_id: actions[i].toolCallId,
                                        output: toolOutput
                                    })
                                    usedTools.push({
                                        tool: tool.name,
                                        toolInput: actions[i].toolInput,
                                        toolOutput
                                    })
                                } catch (e) {
                                    await analyticHandlers.onToolError(toolIds, e)
                                    console.error('Error executing tool', e)
                                    throw new Error(
                                        `Error executing tool. Tool: ${tool.name}. Thread ID: ${threadId}. Run ID: ${runThreadId}`
                                    )
                                }
                            }

                            try {
                                const result = await handleToolSubmission({
                                    openai,
                                    threadId,
                                    runThreadId,
                                    submitToolOutputs,
                                    tools,
                                    analyticHandlers,
                                    parentIds,
                                    llmIds,
                                    sseStreamer,
                                    chatId,
                                    options,

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Read server logs for the `Error executing tool` line — it prints the original error `e`.
  2. Run the named tool standalone with the same args to reproduce.
  3. Fix the tool (credential, args, upstream service).
  4. If the model routinely emits bad args, improve the tool's function schema/description.
  5. Patch the throw to append the cause: `... Run ID: ${runThreadId}. Cause: ${e instanceof Error ? e.message : String(e)}`.

Example fix

// before
                                    throw new Error(
                                        `Error executing tool. Tool: ${tool.name}. Thread ID: ${threadId}. Run ID: ${runThreadId}`
                                    )
// after
                                    throw new Error(
                                        `Error executing tool. Tool: ${tool.name}. Thread ID: ${threadId}. Run ID: ${runThreadId}. Cause: ${e instanceof Error ? e.message : String(e)}`,
                                        { cause: e }
                                    )
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await assistantNode.run(nodeData, input, options)
} catch (e) {
  if ((e as Error).message.startsWith('Error executing tool.')) {
    const toolName = /Tool: ([^.]+)\./.exec((e as Error).message)?.[1]
    // inspect server log for the original tool error, fix that tool
  }
  throw e
}

Prevention

When it happens

Trigger: A configured tool fails when invoked by the assistant: tool credential missing, tool's external API errors, tool input args malformed by the model, tool code throws unexpectedly.

Common situations: Tool needs an API key that is absent; the model produced tool args the tool rejects; the tool's upstream service is down; tool implementation has a bug for certain inputs.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/264d68a961d55c83. Report an issue: GitHub.