broad-brown
broad-brown4mo ago

Vapi-hosted MCP server using Server-Sent Events (SSE)

Hey. I got it running with a selfhosted MCP, but I wanna use SSE, since it can push messages to LibreChat or any client (is that actually the case??). I connected LibreChat to the remote server, I can see tools, and a LLM is able to call them (with valid response from server). The problem is, that it is not able to see which parameter it should send, or isnt aware of any structure of the request. For example, when it calls create_call function, it just makes stuff up about the rest. I believe it only knows the name of the tools. What could be the problem?
4 Replies
Vapi
Vapi4mo ago
It sounds like LibreChat is not injecting the full tool schema (including parameter definitions) into the LLM's context—only the tool names. This usually happens if the client does not parse or forward the tool definitions from the MCP server response. Actionable step:
Check that your client is passing the entire tool schema to the LLM. For example, the tool definition for create_call should look like:
{
"type": "function",
"function": {
"name": "create_call",
"parameters": {
"type": "object",
"properties": {
"assistantId": { "type": "string" },
"phoneNumberId": { "type": "string" },
"customer": { "type": "object", "properties": { "phoneNumber": { "type": "string" } } }
}
},
"description": "Creates an outbound call"
}
}
{
"type": "function",
"function": {
"name": "create_call",
"parameters": {
"type": "object",
"properties": {
"assistantId": { "type": "string" },
"phoneNumberId": { "type": "string" },
"customer": { "type": "object", "properties": { "phoneNumber": { "type": "string" } } }
}
},
"description": "Creates an outbound call"
}
}
Verify that this structure is present in the payload sent to your LLM. If not, update your integration to include the full tool schema from the MCP server response, not just the tool names.
See MCP integration details Sources: - Model Context Protocol (MCP) Integration – How MCP Works - Vapi MCP Server – Core Tools and Example Payloads
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
Shubham Bajaj
Shubham Bajaj4mo ago
Hey, Can you send me the latest call_id? Along with that, can you provide me the duration in the recording where you had this issue?
broad-brown
broad-brownOP4mo ago
call ID: 07767ca0-69e3-42dd-86ac-5cdc38da6a1d { "assistantId": "xxx", "phoneNumberId": "xxxx", "customer": { "phoneNumber": "+xxx" }, "scheduledAt": "2025-05-21T10:09:00+02:00" } thats what LibreChat sends via MCP remote Server to VAPI, and its working......I want it to use "assistantoverride" so i can send additional data to voice agent. Is it possible with mcp?? the call wasnt the problem, it actually worked. But it didnt fill out any dynamic variables
Shubham Bajaj
Shubham Bajaj4mo ago
Yes, you should be able to utilize the MCP tool to collect the variable data at the very beginning of the call so the assistant can access it. You can read more information about dynamic variables here: https://docs.vapi.ai/assistants/dynamic-variables#using-dynamic-variables-in-a-phone-call

Did you find this page helpful?