Hey guys, I’m having a “Bad request - please check your parameters” problem with OpenAI. Everything was working fine until yesterday when I started switching between models. Now, no matter which model I use, I get the same error.
Update: I connected OpenRouter Chat and used Gemini, minimax,deepseek, and glm, and the agent worked. I tried using OpenAI models through OpenRouter, but the same problem persists. However, Sub-agents work fine with OpenAI Chat.
Welcome @Ali4 to our community! I’m Jay and I am a n8n verified creator.
The screenshot shows “Use Responses API” is toggled on in the OpenAI Chat Model node - that’s the culprit. The Responses API uses a different tool calling format and is not fully compatible with n8n’s AI Agent node when attached tools are involved. Turn that toggle off and switch back to the standard Chat Completions API - the “No tool output found for function call” error should disappear immediately. The Responses API toggle is mainly useful if you need streaming or specific Responses API-only features, but for agent workflows with tools it causes this kind of failure.
I got this error: Bad request - please check your parameters
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: call_CPQTMJQP1aC9K7szYjBk97kl
The error comes from OpenAI’s tool calling rule, when the assistant generates tool_calls, each id needs to receive a corresponding tool response. In n8n, this points to some tool/sub-agent connected to the AI Agent (like Call Mortgage Agent or Call Expense Agent) that isn’t returning valid output in some path. I’d test disconnecting the tools one by one and make sure each sub-agent always returns valid output, including on error or when there’s no result.
@Ali4 بناءً على ما قاله @tamy.santos — خطأ “tool_call_ids did not have response messages” بعد تعطيل Responses API يعني أن واحداً على الأقل من subagents المتصلة يرجع قيمة فارغة/غير معرّفة عندما تستدعيها الـ parent agent. بروتوكول OpenAI للأدوات يتطلب أن يحصل كل tool_call_id على أداة استجابة، حتى في المسارات التي لا تعطي نتائج. الحل هو جعل كل subagent تصدر دائماً مخرجات نصية، وليس مصفوفة فارغة أبداً.
ضع عقدة Code التالية كآخر عقدة في كل subagent (قبل أن ترجع إلى الـ parent agent):
الآن حتى عندما لا يكون لدى subagent شيء لترجعه (الفلتر رفض كل العناصر، الـ API أرجع قيمة فارغة، إلخ)، تحصل الـ parent agent على حقل output وبالتالي يكون الـ tool_call_id مرضياً. أسهل طريقة لإيجاد أي subagent تكسر الكود: قطّع الاتصال بينها وبين الـ main agent واحدة تلو الأخرى وشغّل — عندما يختفي الخطأ، تلك هي التي تفتقد المخرجات.