n8n-io/n8n · error · NodeOperationError
Tool name not found in item.json.tool or item.tool
Error message
Tool name not found in item.json.tool or item.tool
What it means
Error "Tool name not found in item.json.tool or item.tool" thrown in n8n-io/n8n.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/mcp/shared/runtime.ts:226
/**
* Run the tool named in `item.json.tool` against the connected client and push
* the result onto `returnData`. Shared by the cached and non-cached execute paths.
*/
async function runToolCall(opts: {
ctx: IExecuteFunctions;
node: INode;
item: INodeExecutionData;
mcpTools: McpTool[];
client: Client;
timeout: number;
itemIndex: number;
returnData: INodeExecutionData[];
}): Promise<void> {
const { ctx, node, item, mcpTools, client, timeout, itemIndex, returnData } = opts;
if (!item.json.tool || typeof item.json.tool !== 'string') {
throw new NodeOperationError(node, 'Tool name not found in item.json.tool or item.tool', {
itemIndex,
});
}
const toolName = item.json.tool;
for (const tool of mcpTools) {
const prefixedName = buildMcpToolName(node.name, tool.name);
if (toolName !== prefixedName) continue;
const { tool: _, ...toolArguments } = item.json;
const schema: JSONSchema7 = tool.inputSchema;
const sanitizedToolArguments: IDataObject =
schema.additionalProperties !== true
? pick(toolArguments, Object.keys(schema.properties ?? {}))
: toolArguments;
const result = await client.callTool(
{ name: tool.name, arguments: sanitizedToolArguments },View on GitHub (pinned to 5ac6606e81)
When it happens
Trigger: Thrown at packages/@n8n/nodes-langchain/nodes/mcp/shared/runtime.ts:226 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/765f8aab776de58d.
Report an issue: GitHub.