n8n-io/n8n · error · NodeOperationError

Tool "${tool.name}" returned an error

Error message

Tool "${tool.name}" returned an error

What it means

Error "Tool "${tool.name}" returned an error" thrown in n8n-io/n8n.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/mcp/shared/runtime.ts:255

		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 },
			CallToolResultSchema,
			{
				timeout,
				signal: ctx.getExecutionCancelSignal(),
			},
		);

		if (node.typeVersion >= 1.3 && result.isError) {
			const errorMessage =
				getErrorDescriptionFromToolCall(result) ?? `Tool "${tool.name}" returned an error`;
			throw new NodeOperationError(node, errorMessage, { itemIndex });
		}

		returnData.push({
			json: {
				response: result.content as IDataObject,
				...(isStructuredContent(result.structuredContent) && {
					structuredContent: result.structuredContent,
				}),
			},
			pairedItem: { item: itemIndex },
		});
	}
}

/**
 * Execute a single MCP tool call from an agent toolkit invocation.
 *
 * The agent passes `item.json.tool` (the prefixed tool name) and the tool arguments

View on GitHub (pinned to 5ac6606e81)

When it happens

Trigger: Thrown at packages/@n8n/nodes-langchain/nodes/mcp/shared/runtime.ts:255 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/fde3150e1ca7aea1. Report an issue: GitHub.