MCP Tool not receiving full parameters when called from litellm

Description:

I’m using n8n to create an MCP server for GitLab API. I created a tool Call_Create_MR_ to create Merge Requests with the following parameters:

  • id (project_id)

  • source_branch

  • target_branch

  • title

  • assignee_ids (array)

  • reviewer_ids (array)

  • labels (array)

Issue:

When calling the tool from litellm with all parameters, only the basic parameters are received (id, source_branch, target_branch, title). Two parameters assignee_ids and reviewer_ids do not appear in the tool call even though they were added to the n8n workflow.

I have tried:

  1. Adding parameters in the “Parameters” section with “Let the model define this parameter” option

  2. Using expression {{ $fromAI('assignee_ids', [], 'json') }} to receive values

  3. Deactivating and publishing the workflow again

Feedback from MCP server:

"feedback": "but when calling the tool, there are still no 2 fields assignee_ids and reviewer_ids"

Questions:

  1. How to make MCP tool receive all parameters from litellm?

  2. Do I need to update the tool schema somewhere else besides the n8n workflow?

  3. Is there a way to debug to see what parameters litellm is passing?

Environment:

  • n8n version: [version]

  • MCP server: custom

  • Litellm: used to call MCP tools

Welcome to the n8n community @tuanduong

Be careful with {{ $fromAI(assignee_ids, , json) }} According to n8n documentation, $fromAI() is for parameters of tools connected to the AI Agent. it is not a universal solution for any MCP Server/custom MCP client. The doc also shows the expected signature as key, description, type, defaultValue, so I would avoid using as the second argument. I would use {{ $fromAI(assignee_ids, GitLab assignee IDs as an array of user IDs, json, ) }}. Confirm if the tool schema that LiteLLM is receiving includes assignee_ids and reviewer_ids.

The problem is likely in how n8n serializes array parameters into the MCP schema that LiteLLM receives, not in the expression itself.

Before changing anything: can you log the raw tool schema LiteLLM sees? If assignee_ids isn’t in the schema at that point, no expression fix will help.

What n8n version are you on?

This?

image

You can define tool schema in your system prompt

This?

To debug what LiteLLM is actually passing to the tool (your question 3), add a Set node right after the MCP Server Trigger and log {{ JSON.stringify($json) }} - that will show you the exact tool call payload LiteLLM is sending. If assignee_ids and reviewer_ids are missing from that payload entirely, the issue is on the LiteLLM/model side (the model is not populating those parameters before calling the tool). If they’re present in the payload but not reaching your HTTP Request node, then it’s a mapping issue inside the workflow.


According to the documentation, the `$fromAI()` function only supports the following AIs:
OpenAI Chat Model
Groq Chat Model
Mistral Cloud Chat Model
Anthropic Chat Model
Azure OpenAI Chat Model
The model I am using is Minimax

The three fields assignee_ids, receiver_ids, and labels are still there, but there are no input fields to enter data.


@tuanduong, welcome to the n8n community.
before I answer you, I’d like to share a best practice with you…
when making a post, please fill in all the requested information so that the community can support you more effectively.
that said, can you share your JSON without the sensitive data?
initially, my guess would be to confirm the configuration of these 3 fields, assignee_ids, receiver_ids = integer and labels = string

thanks you for advice
assignee_ids and receiver_ids = array of integer ( example : [1,2] )
labels = array of string ( example [“test”, “n8n”] )

@tuanduong did you resolve it?