{"record":{"id":"6ceaf838789708a8","repo":"FlowiseAI/Flowise","slug":"this-agent-only-compatible-with-function-calling-m","errorCode":null,"errorMessage":"This agent only compatible with function calling models.","messagePattern":"This agent only compatible with function calling models\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/multiagents/Supervisor/Supervisor.ts","lineNumber":203,"sourceCode":"                    })\n            } else if (llm instanceof ChatAnthropic) {\n                // Force Anthropic to use tool : https://docs.anthropic.com/claude/docs/tool-use#forcing-tool-use\n                userPrompt = `Given the conversation above, who should act next? Or should we FINISH? Select one of: ${memberOptions.join(\n                    ', '\n                )}. Use the ${routerToolName} tool in your response.`\n\n                let prompt = ChatPromptTemplate.fromMessages([\n                    ['system', systemPrompt],\n                    new MessagesPlaceholder('messages'),\n                    ['human', userPrompt]\n                ])\n\n                const messages = await processImageMessage(1, llm, prompt, nodeData, options)\n                prompt = messages.prompt\n                multiModalMessageContent = messages.multiModalMessageContent\n\n                if ((llm as any).bindTools === undefined) {\n                    throw new Error(`This agent only compatible with function calling models.`)\n                }\n\n                const modelWithTool = (llm as any).bindTools([tool])\n\n                const outputParser = new ToolCallingAgentOutputParser()\n\n                supervisor = prompt\n                    .pipe(modelWithTool)\n                    .pipe(outputParser)\n                    .pipe((x) => {\n                        if (Array.isArray(x) && x.length) {\n                            const toolAgentAction = x[0] as any\n                            return {\n                                next: toolAgentAction.toolInput.next,\n                                instructions: toolAgentAction.toolInput.instructions,\n                                team_members: members.join(', ')\n                            }\n                        } else if (typeof x === 'object' && 'returnValues' in x) {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/multiagents/Supervisor/Supervisor.ts#L185-L221","documentation":"Thrown in the ChatAnthropic branch of Supervisor.createTeamSupervisor() when llm.bindTools is undefined. The supervisor forces tool-calling (a RouteTool) to pick the next worker, so the model must support function/tool calling. Anthropic models support this, so hitting the guard usually means the model instance is not actually a ChatAnthropic or is an old/wrapped version without bindTools.","triggerScenarios":"Selecting an LLM that lands in the ChatAnthropic instanceof branch but whose instance (or prototype) lacks bindTools — e.g. an older @langchain/anthropic version, a custom subclass, or a mock in tests. Also if a non-Anthropic model is misregistered to be detected as Anthropic.","commonSituations":"Downgrading or pinning @langchain/anthropic to a pre-tool-calling version. Using a custom ChatModel wrapper. Version skew between flowise-components and langchain packages.","solutions":["Upgrade @langchain/anthropic (and langchain core) to a version that implements BaseChatModel.bindTools (recent 0.1.x / 0.2.x).","Pick a model class that natively supports tool calling (ChatOpenAI, ChatAnthropic, ChatGoogleGenerativeAI, ChatMistralAI).","If using a custom model wrapper, expose bindTools on its prototype delegating to the underlying model.","Verify there is no duplicate/old langchain install with `npm ls @langchain/core`."],"exampleFix":"// before\n// pinned ancient @langchain/anthropic without bindTools\n// after\nnpm i @langchain/anthropic@latest @langchain/core@latest","handlingStrategy":"type-guard","validationCode":"import type { BaseChatModel } from '@langchain/core/language_models/chat_models'\nfunction assertSupportsToolCalling(llm: BaseChatModel): void {\n  if (typeof (llm as any).bindTools !== 'function') {\n    throw new Error(`Model ${llm.constructor.name} does not support tool calling (bindTools missing). Pick a function-calling model.`)\n  }\n}\n// call before invoking Supervisor.init / createTeamSupervisor","typeGuard":"import type { BaseChatModel } from '@langchain/core/language_models/chat_models'\nfunction supportsToolCalling(llm: BaseChatModel): boolean {\n  return typeof (llm as unknown as { bindTools?: unknown }).bindTools === 'function'\n}","tryCatchPattern":"try {\n  await supervisorNode.init(nodeData, _, options)\n} catch (e) {\n  if ((e as Error).message === 'This agent only compatible with function calling models.') {\n    // switch the LLM to a ChatAnthropic version that implements bindTools, or another supported class\n  }\n  throw e\n}","preventionTips":["Keep @langchain/anthropic and @langchain/core versions aligned and current.","Filter the LLM picker in the UI to function-calling-capable models for the Supervisor node.","Smoke-test bindTools presence in a startup self-check for the chosen model."],"tags":["supervisor","multiagent","llm","tool-calling","version-skew","anthropic"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}