{"record":{"id":"eb5d0cb0460e335a","repo":"n8n-io/n8n","slug":"error-message-this-is-most-likely-because-s","errorCode":null,"errorMessage":"${error.message}.\n\t\t\tThis is most likely because some of your tools are configured to require a specific schema. This is not supported by Conversational Agent. Remove the schema from the tool configuration or use Tools agent instead.","messagePattern":"(.+?)\\.\n\t\t\tThis is most likely because some of your tools are configured to require a specific schema\\. This is not supported by Conversational Agent\\. Remove the schema from the tool configuration or use Tools agent instead\\.","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/utils/schemaParsing.ts","lineNumber":57,"sourceCode":"): JSONSchema7 {\n\tconst parsedExample = jsonParse<SchemaObject>(exampleJsonString);\n\n\tconst schema = generateJsonSchema(parsedExample) as JSONSchema7;\n\n\tif (allFieldsRequired) {\n\t\treturn makeAllPropertiesRequired(schema);\n\t}\n\n\treturn schema;\n}\n\nexport function convertJsonSchemaToZod<T extends z.ZodTypeAny = z.ZodTypeAny>(schema: JSONSchema7) {\n\treturn jsonSchemaToZod<T>(schema);\n}\n\nexport function throwIfToolSchema(ctx: IExecuteFunctions, error: Error) {\n\tif (error?.message?.includes('tool input did not match expected schema')) {\n\t\tthrow new NodeOperationError(\n\t\t\tctx.getNode(),\n\t\t\t`${error.message}.\n\t\t\tThis is most likely because some of your tools are configured to require a specific schema. This is not supported by Conversational Agent. Remove the schema from the tool configuration or use Tools agent instead.`,\n\t\t);\n\t}\n}\n","sourceCodeStart":39,"sourceCodeEnd":64,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/utils/schemaParsing.ts#L39-L64","documentation":"Thrown by throwIfToolSchema when a tool used with the Conversational Agent rejects its input because the tool was configured with a strict JSON input schema. The Conversational Agent (unlike the Tools Agent) does not validate or shape its LLM-generated arguments against a tool schema, so any tool that enforces one fails at invocation. The wrapper re-throws the original schema-mismatch text with guidance to remove the schema or switch agents.","triggerScenarios":"An LLM call in a Conversational Agent node invokes a tool whose descriptor carries an `inputSchema` (e.g. a Function tool with `schema: z.object({...})` or a custom tool with `description` + structured input). The tool's runtime rejects the agent's free-form arguments with a message containing the substring 'tool input did not match expected schema', which throwIfToolSchema matches and re-wraps.","commonSituations":"Importing a tool built for the Tools Agent into a Conversational Agent workflow; upgrading n8n where a tool newly added a required schema; community tools that always declare structured input; mixing a structured-output tool (e.g. a calculator with typed operands) with the Conversational Agent.","solutions":["Open the failing tool node's configuration and remove or loosen its input schema (delete the `schema`/`inputSchema` property so the tool accepts a free-form object).","Switch the parent agent node from 'Conversational Agent' to 'Tools Agent', which honors tool schemas.","Replace the structured tool with an equivalent tool that parses its own arguments from a single string or generic object."],"exampleFix":"// before - tool descriptor with a strict schema\nconst tool = new DynamicTool({\n  name: 'calculate',\n  description: 'calculate',\n  func: (input) => calc(JSON.parse(input)),\n  schema: z.object({ a: z.number(), b: z.number(), op: z.string() }), // triggers 920 under Conversational Agent\n});\n\n// after - drop the schema, parse arguments manually\nconst tool = new DynamicTool({\n  name: 'calculate',\n  description: 'Pass JSON like {\"a\":1,\"b\":2,\"op\":\"+\"}',\n  func: (input) => calc(JSON.parse(input)),\n});","handlingStrategy":"type-guard","validationCode":"function isSchemalessTool(tool: { schema?: unknown }): boolean {\n  return tool.schema === undefined || tool.schema === null;\n}\n\nconst toolsForConversationalAgent = allTools.filter(isSchemalessTool);\nif (toolsForConversationalAgent.length !== allTools.length) {\n  throw new Error('Some tools carry a schema; use the Tools Agent instead.');\n}","typeGuard":"import type { StructuredTool } from '@langchain/core/tools';\n\nfunction isSchemaless(tool: StructuredTool | { schema?: unknown }): boolean {\n  // DynamicTool has no schema; StructuredTool has a non-undefined `schema`\n  return (tool as { schema?: unknown }).schema === undefined;\n}","tryCatchPattern":null,"preventionTips":["Maintain two tool sets - schemaless for Conversational Agent, structured for Tools Agent - and assert membership at workflow load.","In tool wrappers, expose a `supportsConversationalAgent: boolean` flag and fail the workflow at validation time if a structured tool lands under a Conversational Agent.","Document each tool's schema requirement in its description so workflow builders pick the right agent."],"tags":["langchain","agent","tool-schema","configuration"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}