flat-fuchsia•4mo ago
Format to return mcp server response to vapi tool call.
Is there a specific format that we need to follow to return a response from vapi tool call to an mcp server ?
4 Replies
Yes, there is a specific format you must follow when returning a response from your MCP server to a Vapi tool call.
Return a JSON object like this: Replace
See official docs for details. Source: - Vapi Custom Tools Documentation
Return a JSON object like this: Replace
YOUR_TOOL_CALL_ID
with the ID from the incoming request, and YOUR_RESULT
with your tool's output.See official docs for details. Source: - Vapi Custom Tools Documentation
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
flat-fuchsiaOP•4mo ago
@Duckie I do not see the toold id in the mcp server query
To return a response from your MCP server to a Vapi tool call, use this JSON format:
Replace
See official docs for details. Source: - Vapi Custom Tools Documentation
YOUR_TOOL_CALL_ID
with the ID from the incoming request (look for it in the tool call payload), and set YOUR_RESULT
to your tool's output. This format is required for Vapi to process your tool's response correctly.See official docs for details. Source: - Vapi Custom Tools Documentation
Yes, when Vapi AI sends a tool-call to your MCP server, you must return a valid JSON response in the format {"result": "your message"} or {"result": {"message": "your message", "data": {...}}} to ensure proper integration and response handling.