Unable to add MCP to tools config
# support
e
MCP tools require a
name
field, however when add
name
to the MCP tool, the vapi server side validation fails:
Copy code
{
    type: 'mcp',
    name: 'Calendly',
    description: 'When scheduling bookings use this tool',
    server: {
      url: 'https://mcp.zapier.com/api/mcp/s/.....'
    }
  }
]
Error: Status code: 400
Body: {
  "message": [
    "model.each value in tools.property name should not exist"
  ],
  "error": "Bad Request",
  "statusCode": 400
}
We're using openai as the model and follow the documentation. https://docs.vapi.ai/tools/mcp Not adding
name
to the tool config fails as well, then we get error name is required for mcp tool...
v
Try removing the
name
and
description
fields from your MCP tool config, as the documentation specifies they should not be present for MCP tools.
Your config should look like this:
Copy code
json
{
  "type": "mcp",
  "server": {
    "url": "https://mcp.zapier.com/api/mcp/s/....."
  }
}
If you still receive a "name is required" error after this change, it may indicate a bug or a version mismatch—consider reaching out to Vapi support or their Discord for clarification. [See official MCP tool config example](https://docs.vapi.ai/tools/mcp) Source: - [Vapi Documentation: MCP Tool](https://docs.vapi.ai/tools/mcp)
e
apparently the tools/mcp docs are incorrect. Format should be:
Copy code
tools.push({
  type: 'mcp',
   function: {
     name: 'Calendly',
     description: 'When scheduling bookings use this tool'
  },
  server: {
    url: action.serverUrl,
  },
}
However this fails to execute individual tools on the mcp server
Copy code
15:23:44:025
[ERROR]
Tool `mcp:Calendly` failed (reason: MCP error -32602: MCP error -32602: Tool Calendly not found)
v
Hey! To help track down this issue, could you share: - The call ID This would really help us figure out what went wrong!
e
Without name in the tool: 3e8fb647-58d5-4b48-80eb-f09a343f5b85
With name in the tool: 5767c2c1-5abf-48ea-890f-1920e2c0ff62
bot err
v
Hey, for the first call, it's clearly and obviously visible that there's a tool name missing that's why it's throwing an error. For the second call, when it connects to the MCP server, there is no tool name Calendly, and that's why it fails. I'll suggest you to check your MCP server to see if a currently tool exists.
e
Ofcourse i have this observation as well, but that is not the problem... The entire point of MCP is that the assistant will choose the proper tool van the MCP, but when a function name is added, as per API spec, the assistant will call the MCP with that function name, instead of choosing the appropriate tool from the MCP. That still leaves the issue that the MCP documentation is incorrect.
v
Hey @Eelco I am looking into your issue and let me check the documentation and then I will get back to you on this.
Hey Eelco, could you please try again now? The issue has been fixed. Let me know how it goes for you.
m
I have the same issue with my mcp server connection. I get the tools call but It passes It as a function? "tool_calls": [ { "id": "call_HezzYExhT18cOwhEJsDyUM5t", "type": "function", "function": { "name": "mcp_tool", "arguments": "{}" } } ] }, { "role": "tool", "content": "{\n \"error\": \"MCP error -32602: MCP error -32602: Tool mcp_tool not found\"\n}", "tool_call_id": "call_HezzYExhT18cOwhEJsDyUM5t" }, {
I tried deleting it
And doing everything i could but i keep getting same problem @Shubham Bajaj
v
Hey Marcos, can you share the call id?
e
@Shubham Bajaj Thanks, adding the MCP in the global tools now seems to work. However 1. The documentation is still incorrect and not useful at all: https://docs.vapi.ai/tools/mcp 2. The method shown in the mcp docs, by adding the tool to the
tools
object in the
model
config does not work. Just to be clear this example is broken.
Copy code
ts
{
  "model": {
    "provider": "openai",
    "model": "gpt-4o",
    "messages": [
      {
        "role": "system",
        "content": "... removed for brievety"
      }
    ],
    "tools": [
      {
        "type": "mcp",
        "name": "mcpTools", // this field does not exist in the api, however a name is required
        "server": {
            "url": "https://actions.zapier.com/mcp/actions/"
        }
      }
    ]
  }
}
It will result in this error:
Copy code
ts
Body: {
  "message": [
    "model.each value in tools.property name should not exist"
  ],
  "error": "Bad Request",
  "statusCode": 400
}
Adding the name in the
function.name
parameter allow us to save the configuration, however then the assistant fails to add and execute the mcp tools, it results in the same issue i described before, where it will literally try to call that function name on the mcp server. So it seems like the MCP tool in the
model.tools
config are interpreted as regular tools, instead of being used to fetch the mcp tools and dynamically add them to the assistants tools.
v
Hey Eelco this ticket has been closed because of no response please create a new support ticket.
r
@Eelco Did you ever figure out a solution for this? I'm running into this problem 4 months later... and the docs still remain incorrect
5 Views