{"record":{"id":"264d68a961d55c83","repo":"FlowiseAI/Flowise","slug":"error-executing-tool-tool-tool-name-thread-i","errorCode":null,"errorMessage":"Error executing tool. Tool: ${tool.name}. Thread ID: ${threadId}. Run ID: ${runThreadId}","messagePattern":"Error executing tool\\. Tool: (.+?)\\. Thread ID: (.+?)\\. Run ID: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/agents/OpenAIAssistant/OpenAIAssistant.ts","lineNumber":587,"sourceCode":"                                    const toolOutput = await tool.call(actions[i].toolInput, undefined, undefined, {\n                                        sessionId: threadId,\n                                        chatId: options.chatId,\n                                        input\n                                    })\n                                    await analyticHandlers.onToolEnd(toolIds, toolOutput)\n                                    submitToolOutputs.push({\n                                        tool_call_id: actions[i].toolCallId,\n                                        output: toolOutput\n                                    })\n                                    usedTools.push({\n                                        tool: tool.name,\n                                        toolInput: actions[i].toolInput,\n                                        toolOutput\n                                    })\n                                } catch (e) {\n                                    await analyticHandlers.onToolError(toolIds, e)\n                                    console.error('Error executing tool', e)\n                                    throw new Error(\n                                        `Error executing tool. Tool: ${tool.name}. Thread ID: ${threadId}. Run ID: ${runThreadId}`\n                                    )\n                                }\n                            }\n\n                            try {\n                                const result = await handleToolSubmission({\n                                    openai,\n                                    threadId,\n                                    runThreadId,\n                                    submitToolOutputs,\n                                    tools,\n                                    analyticHandlers,\n                                    parentIds,\n                                    llmIds,\n                                    sseStreamer,\n                                    chatId,\n                                    options,","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/agents/OpenAIAssistant/OpenAIAssistant.ts#L569-L605","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read server logs for the `Error executing tool` line — it prints the original error `e`.","Run the named tool standalone with the same args to reproduce.","Fix the tool (credential, args, upstream service).","If the model routinely emits bad args, improve the tool's function schema/description.","Patch the throw to append the cause: `... Run ID: ${runThreadId}. Cause: ${e instanceof Error ? e.message : String(e)}`."],"exampleFix":"// before\n                                    throw new Error(\n                                        `Error executing tool. Tool: ${tool.name}. Thread ID: ${threadId}. Run ID: ${runThreadId}`\n                                    )\n// after\n                                    throw new Error(\n                                        `Error executing tool. Tool: ${tool.name}. Thread ID: ${threadId}. Run ID: ${runThreadId}. Cause: ${e instanceof Error ? e.message : String(e)}`,\n                                        { cause: e }\n                                    )","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await assistantNode.run(nodeData, input, options)\n} catch (e) {\n  if ((e as Error).message.startsWith('Error executing tool.')) {\n    const toolName = /Tool: ([^.]+)\\./.exec((e as Error).message)?.[1]\n    // inspect server log for the original tool error, fix that tool\n  }\n  throw e\n}","preventionTips":["Configure credentials for every tool the assistant may call.","Tighten tool function schemas so the model emits valid args.","Test each tool standalone before adding it to the assistant.","Monitor onToolError analytics to catch failing tools early."],"tags":["agent","openai-assistant","tool-execution","error-wrapping","cause-loss"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}