{"record":{"id":"cacfe6a0a7fd1675","repo":"n8n-io/n8n","slug":"llm-does-not-support-tools","errorCode":null,"errorMessage":"LLM does not support tools","messagePattern":"LLM does not support tools","errorType":"exception","errorClass":"LLMServiceError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-workflow-builder.ee/src/subgraphs/discovery.subgraph.ts","lineNumber":332,"sourceCode":"\n\t\t// Create agent with tools bound (including submit tool)\n\t\tconst systemPrompt = ChatPromptTemplate.fromMessages([\n\t\t\t[\n\t\t\t\t'system',\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\ttext: discoveryPrompt,\n\t\t\t\t\t\tcache_control: { type: 'ephemeral' },\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t],\n\t\t\t['human', '{prompt}'],\n\t\t\t['placeholder', '{messages}'],\n\t\t]);\n\n\t\tif (typeof config.llm.bindTools !== 'function') {\n\t\t\tthrow new LLMServiceError('LLM does not support tools', {\n\t\t\t\tllmModel: config.llm._llmType(),\n\t\t\t});\n\t\t}\n\n\t\t// Bind all tools including the output tool\n\t\tconst allTools = [...tools, submitTool];\n\t\tthis.agent = systemPrompt.pipe(config.llm.bindTools(allTools));\n\t\tthis.plannerAgent = createPlannerAgent({\n\t\t\tllm: config.plannerLLM,\n\t\t\ttools: [\n\t\t\t\tcreateGetDocumentationTool().tool,\n\t\t\t\tcreateWebFetchTool(plannerSecurityFactory, ssrf).tool,\n\t\t\t],\n\t\t});\n\n\t\t// Build the subgraph\n\t\tconst subgraph = new StateGraph(DiscoverySubgraphState)\n\t\t\t.addNode('discovery_agent', this.callAgent.bind(this))","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/src/subgraphs/discovery.subgraph.ts#L314-L350","documentation":"Construction-time guard in the discovery subgraph: config.llm.bindTools is not a function, so the agent cannot be created with the discovery tools (including the required submit tool). LLMServiceError records the offending model via _llmType(). Thrown during create/compile, before any discovery prompt runs.","triggerScenarios":"Thrown at packages/@n8n/ai-workflow-builder.ee/src/subgraphs/discovery.subgraph.ts:332 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a LangChain chat model with bindTools support for the discovery subgraph","Wrap the model in a tool-capable adapter","Verify the model type logged in the error's llmModel field and replace it with a tool-calling variant"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","contentChangedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}