How to debug an agent?

I’m having issues with workflow which was working without issues and now my agent are throwing errors. Can anyone help me debug this issue?

The error is “Received tool input did not match expected schema”, however, I can see every tool call was successful with the correct data returned, so I cannot get to the bottom of the error.

{
  "errorMessage": "Received tool input did not match expected schema",
  "errorDetails": {},
  "n8nDetails": {
    "n8nVersion": "1.63.4 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "Error: Received tool input did not match expected schema",
      "    at DynamicStructuredTool.call (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/tools/index.cjs:103:19)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/langchain/dist/agents/executor.cjs:486:27",
      "    at async Promise.all (index 0)",
      "    at AgentExecutor._call (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/agents/executor.cjs:478:30)",
      "    at AgentExecutor.invoke (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/chains/base.cjs:58:28)",
      "    at Object.toolsAgentExecute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/agents/Agent/agents/ToolsAgent/execute.js:180:30)",
      "    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/agents/Agent/Agent.node.js:352:20)",
      "    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:722:19)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:711:51"
    ]
  }
}

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Wayne ,

I see that you’ve posted in a related post here: [Error - Langchain Integration - AI Tool Agent] Received tool input did not match expected schema at DynamicStructuredTool.call - #19 by Artur_Ferreira_Padua

Adding it here so other users can follow this topic :slight_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.