n8n-io/n8n · error · NodeOperationError

Tools Agent requires Chat Model which supports Tools calling

Error message

Tools Agent requires Chat Model which supports Tools calling

What it means

Thrown by getChatModel (Tools Agent common.ts) when the connected model either is not a chat-model instance (isChatInstance returns false) or does not implement bindTools. Tools Agent requires a chat model that supports tool calling; classic LLMs or completion-only models are rejected.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/agents/Agent/agents/ToolsAgent/common.ts:498

	index: number = 0,
): Promise<BaseChatModel | undefined> {
	const connectedModels = await ctx.getInputConnectionData(NodeConnectionTypes.AiLanguageModel, 0);

	let model;

	if (Array.isArray(connectedModels) && index !== undefined) {
		if (connectedModels.length <= index) {
			return undefined;
		}
		// We get the models in reversed order from the workflow so we need to reverse them to match the right index
		const reversedModels = [...connectedModels].reverse();
		model = reversedModels[index] as BaseChatModel;
	} else {
		model = connectedModels as BaseChatModel;
	}

	if (!isChatInstance(model) || !model.bindTools) {
		throw new NodeOperationError(
			ctx.getNode(),
			'Tools Agent requires Chat Model which supports Tools calling',
		);
	}
	return model;
}

/**
 * Retrieves the memory instance from the input connection if it is connected
 *
 * @param ctx - The execution context
 * @returns The connected memory (if any)
 */
export async function getOptionalMemory(
	ctx: IExecuteFunctions | ISupplyDataFunctions | IWebhookFunctions,
): Promise<BaseChatMemory | undefined> {
	return (await ctx.getInputConnectionData(NodeConnectionTypes.AiMemory, 0)) as
		| BaseChatMemory

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Connect a chat model that supports tool calling (e.g. OpenAI Chat Model, Anthropic Chat Model, Google Gemini Chat Model) to the Chat Model input.
  2. Verify the connected node is a chat-model node and not an embedding, LLM, or memory node.
  3. Upgrade @n8n/nodes-langchain / langchain dependencies so bindTools is present.
Defensive patterns

Strategy: type-guard

Validate before calling

const model = await getChatModel(this, 0);
if (!model) {
  throw new NodeOperationError(this.getNode(), 'No chat model connected to the Agent.');
}

Type guard

function isToolCallingChatModel(model: unknown): model is BaseChatModel {
  return (
    !!model &&
    typeof (model as any).bindTools === 'function' &&
    isChatInstance(model)
  );
}

Prevention

When it happens

Trigger: A non-chat-model node (e.g. a legacy LLM Chain model, a completion-only model, or a custom model that doesn't extend BaseChatModel) is connected to the Agent's Chat Model input; or the chat model exists but lacks bindTools (older LangChain version).

Common situations: User connected an older model node; a community node exposes a non-chat model; LangChain version mismatch where bindTools is absent; misrouted connection (memory or embedding node plugged into the model input).

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/ddf44f1b93455495. Report an issue: GitHub.