Function and MCP tool calling issues
# support
u
Hi there, I have 2 issues: 1. First one is the MCP call. When I pass the MCP call configuraiton based off of this link https://docs.vapi.ai/api-reference/webhooks/server-message#response.body.messageResponse.AssistantRequest.assistant.model.OpenAI.tools.McpTool . The assistant does not even try to call the MCP. Here's the a sample configuration I use tools: [ { type: "mcp", function: { name: "mcpTools", }, server: { url: "https://your-mcp-server-url/mcp", }, }, ] 2. So I ended up just doing a function call. Now the issue with this function call is that, the agent DOES call it, but responds too quickly even before it gets the response. I can see it trying to reach out to it and it does respond as expected. But the agent assumes there are no results so it responds with the "request-failed" message.
v
Suggestion: To ensure your MCP tool is recognized and invoked, add it via the Vapi Dashboard as follows: 1. Go to Dashboard > Assistants > select your assistant. 2. Open the Tools tab, select your MCP tool from the dropdown, and click Publish. Sample configuration for reference:
Copy code
json
{
  "type": "mcp",
  "function": { "name": "mcpTools" },
  "server": { "url": "https://your-mcp-server-url/mcp" }
}
This ensures Vapi fetches and injects the MCP tools correctly. For more details, see the [MCP documentation](https://docs.vapi.ai/tools/mcp). Source: - [MCP documentation](https://docs.vapi.ai/tools/mcp)
u
@Vapi Support Bot yes that's what i did before.
v
Thank you for clarifying that you've already added the MCP tool via the dashboard as described. Based on the information I have, I do not have additional details about why the MCP call is not being triggered or why the agent responds too quickly before receiving the function call response. Without further documentation or specific troubleshooting steps, I am unable to provide a direct solution to these issues. If you have any other details or specific error messages, feel free to share them, and I'll do my best to help!
u
@Vapi Support Bot it also did not call the tool if i used the "toolIds" property
v
Thank you for the details so far. To help diagnose why the MCP tool or function call isn't being triggered, could you please check the Call Logs or API Logs in your [Vapi dashboard](https://dashboard.vapi.ai/) and let me know if there are any error messages or tool execution entries related to your attempts? This will help pinpoint where the process might be failing. Sources: - [MCP documentation](https://docs.vapi.ai/tools/mcp) - [Debugging documentation](https://docs.vapi.ai/debugging)
c
Sorry for the delay on this one. Looking at your two issues: MCP not being called: One thing worth checking is whether your MCP server is reachable at call start time. Vapi fetches the tool list from your MCP server when the call begins, so if there's any latency or connectivity issue at that moment, the tools won't be injected and the assistant won't know they exist. Could you share a call ID where you experienced this? I can pull the logs and confirm whether Vapi attempted the MCP fetch at all. Function call returning "request-failed": This is almost always a timeout issue. Vapi's webhook timeout for function calls is 20 seconds by default. If your server's response arrives after that window, Vapi marks the call as failed and the assistant moves on before getting the result. A few things to check: how long does your function server typically take to respond, and do you have a
timeoutSeconds
field configured on the function tool? If you can share a call ID for either issue, I can dig into the exact logs and give you a definitive answer.