AI Agent only outputs JSON instead of passing it to a tool

Describe the problem/error/question

Hey everyone,

I’m having an issue with my n8n AI Agent. It’s not actually executing my custom tool (MCP). Instead, it only returns the raw JSON call, for example calculate tool:

{"input":"574389545 * 473284"}

So instead of calling the tool and processing the result, the agent just prints out what looks like the function call payload.

Has anyone run into this issue before, or knows what might cause n8n to only show the tool call JSON instead of executing it?

This problem exists in any type of tool.

My setup:

  • AI Agent node (OpenAI)
  • Model: GPT-OSS 20b Local model

Thanks in advance!

What is the error message (if any)?

No error message

Please share your workflow

Share the output returned by the last node

output
{“input”:“574389545 * 473284”}

Information on your n8n setup

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

Try changing the model. Some models have issues with calling tools. OpenRouter offers free models that are very good for development stage. Make sure to change the language of your system prompt to English, models work best with it.

Hi Mookie,

Thanks for the input.

In the meantime, I also tested with the OpenAI API and found that the tool call works there without any issues. After doing a bit more research, I discovered the connection.

Our local LLM runs on vLLM. For the GPT-OSS model, I had to add the parameters:

 --enable-auto-tool-choice --tool-call-parser openai

After that, the tool call also worked smoothly with our local LLM.

1 Like

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