{"record":{"id":"243404266a364643","repo":"n8n-io/n8n","slug":"llm-does-not-support-bindtools-cannot-use-tools","errorCode":null,"errorMessage":"LLM does not support bindTools - cannot use tools for node discovery","messagePattern":"LLM does not support bindTools - cannot use tools for node discovery","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-workflow-builder.ee/src/code-builder/handlers/chat-setup-handler.ts","lineNumber":219,"sourceCode":"\n\t\treturn generateWorkflowCode({\n\t\t\tworkflow: currentWorkflow,\n\t\t\texecutionSchema: payload.workflowContext?.executionSchema,\n\t\t\texecutionData: payload.workflowContext?.executionData,\n\t\t\texpressionValues: payload.workflowContext?.expressionValues,\n\t\t\tvaluesExcluded: payload.workflowContext?.valuesExcluded,\n\t\t\tpinnedNodes: payload.workflowContext?.pinnedNodes,\n\t\t});\n\t}\n\n\t/**\n\t * Bind tools to LLM\n\t *\n\t * @returns LLM with tools bound, typed for use with AgentIterationHandler\n\t */\n\tprivate bindToolsToLlm(textEditorEnabled: boolean, hasPlanOutput: boolean): LlmWithTools {\n\t\tif (!this.llm.bindTools) {\n\t\t\tthrow new Error('LLM does not support bindTools - cannot use tools for node discovery');\n\t\t}\n\n\t\t// When an approved plan is provided, exclude get_suggested_nodes\n\t\t// because the plan already contains curated node suggestions per step\n\t\tlet tools: Array<\n\t\t\t| StructuredToolInterface\n\t\t\t| typeof TEXT_EDITOR_TOOL\n\t\t\t| typeof VALIDATE_TOOL\n\t\t\t| typeof BATCH_STR_REPLACE_TOOL\n\t\t> = hasPlanOutput ? this.tools.filter((t) => t.name !== 'get_suggested_nodes') : this.tools;\n\n\t\tif (textEditorEnabled) {\n\t\t\ttools = [...tools, TEXT_EDITOR_TOOL, VALIDATE_TOOL, BATCH_STR_REPLACE_TOOL];\n\t\t}\n\n\t\treturn this.llm.bindTools(tools) as LlmWithTools;\n\t}\n","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/src/code-builder/handlers/chat-setup-handler.ts#L201-L237","documentation":"Error \"LLM does not support bindTools - cannot use tools for node discovery\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/ai-workflow-builder.ee/src/code-builder/handlers/chat-setup-handler.ts:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}