Skip to content

Conversation

@yehorkardash
Copy link
Contributor

Summary

This PR fixes a bug when OpenAi node couldn't call some tools that passed additionalProperties: {} together with strict: true.

In that case it OpenAi throws Invalid schema for function 'function_name': In context=('additionalProperties',), schema must have a 'type' key.

This fix replaces empty objects when strict is true to false.

The simplest reproduction is to use MCP trigger workflow and call it in OpenAI node
When only url can be defined by AI, and it's the only required property, strict is true which caused this error.

{
  "nodes": [
    {
      "parameters": {
        "path": "c79b11d9-3cda-41fa-b61e-3dcbbbaf23a0"
      },
      "type": "@n8n/n8n-nodes-langchain.mcpTrigger",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "id": "09943e91-2637-410e-8906-90d1ec83df5d",
      "name": "MCP Server Trigger",
      "webhookId": "c79b11d9-3cda-41fa-b61e-3dcbbbaf23a0"
    },
    {
      "parameters": {
        "toolDescription": "Makes http POST request using provided url and json",
        "method": "POST",
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', ``, 'string') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequestTool",
      "typeVersion": 4.3,
      "position": [
        96,
        240
      ],
      "id": "05e2bb28-d517-41f3-9b1d-869aae3bd794",
      "name": "make_http_request"
    }
  ],
  "connections": {
    "make_http_request": {
      "ai_tool": [
        [
          {
            "node": "MCP Server Trigger",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "instanceId": "869de6ef8ff5644147e5589ff5c9f86171de90b2c3bb7db31c1025ea70eaa896"
  }
}

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-3828/community-issue-openai-node-built-in-mcp-eliminated-but-n8n-mcps-are
closes #21272

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added the n8n team Authored by the n8n team label Oct 29, 2025
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

n8n team Authored by the n8n team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Openai Node: Built In MCP eliminated but n8n MCPs are not working

2 participants