Tools Calls Error on AI Agent Node

Describe the problem/error/question

Hello everyone. I was running my workflow just fine, but refining System Message in my AI Agent node and suddenly it stopped working, always throwing a message about ‘tool_use’, ‘tool calls’, ‘tool_result’, in both anthropic and OpenAi models. I’ve already rollback my workflow, deactivated all tools connected to my agent, removed the tools description from the System Message, etc. but none worked and I’m really lost here.

The raw error coming from Anthropic model in my AI agent: messages.14: tool_use ids were found without tool_result blocks immediately after: toolu_013rRWPuR9wrMJQ5QCA4ao1K. Each tool_use block must have a corresponding tool_result block in the next message.

Raw error using gpt-5: An assistant message with ‘tool_calls’ must be followed by tool messages responding to each ‘tool_call_id’. The following tool_call_ids did not have response messages: toolu_013rRWPuR9wrMJQ5QCA4ao1K Someone already experienced something like this?

Information on your n8n setup

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

Hi @vhzg , welcome to the n8n community!

the agent is trying to use a tool, but the tool’s response is not appearing right after, so the model’s internal conversation breaks. Since it happens with both Anthropic and OpenAI, I don’t think this is a model-specific issue, but more likely something with the agent history, memory, or configuration. I’d test it with a completely fresh execution, clear the memory/session state, and make sure the agent has no tools connected at all; if it still happens, then the next thing to check is the AI Agent configuration and the nodes linked to it.

Hi @vhzg Can you share your complete workflow?

Hey friends. Thanks for replying and helping me. I’ve reviewed the wokflow and found that the AI agent saved on his memory a call to a tool, so eveytime and ran my workflow, there was this tool in his prompt, and even deleting tools, or refactoring my system prompt wouldn’t work because of this memory. So I cleaned it (using Redis) and everything was back to normal.

Thank you both a lot for the help!

2 Likes

great news!

Your chat memory has a corrupted conversation where a tool_use block got stored without the matching tool_result. Clear the session/memory for that agent (delete the chat history in your memory node or database) and it should work on the next run.

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