Vapi bug speaking tool call outloud instead of exe...
# support
j
Call id: 019b8ab4-c60d-7775-9f26-833f89ff9fa5 OpenAI returned: "response": { "content": "{\"tool_uses\":[{\"recipient_name\":\"functions.rest-api\",\"parameters\":{\"toolConfigName\":\"SearchPolicyPhoneAPI\"}}]}" } But vapi didn't recognize this as a tool call and instead fed this exact string to eleven labs...
c
Hi there, Thank you for your message. Our team is currently out of the office. We operate Monday through Friday, from 9:00 AM to 8:00 PM Pacific Standard Time (PST). We’ll get back to you as soon as possible during our normal business hours. If your message is urgent, please mark it accordingly or include “URGENT” in the subject line, and we’ll do our best to respond promptly. Warm regards, Vapi Customer Support Team
v
To report this Vapi tool call bug, submit your issue using the recommended format:
Copy code
Call ID: 019b8ab4-c60d-7775-9f26-833f89ff9fa5
Issue: Vapi spoke the tool call content out loud instead of executing the tool.
Expected: Vapi should recognize and execute the tool call, not send it to the voice provider.
Actual: The tool call string was spoken by Eleven Labs.
Submit this report via the [Vapi issue reporting guide](https://docs.vapi.ai/issue-reporting) for fastest resolution. Source: - [Vapi Issue Reporting Guide](https://docs.vapi.ai/issue-reporting)
j
This happens because the model is returning the tool call as plain text (stringified JSON), so VAPI doesn’t detect it and sends it straight to ElevenLabs. VAPI only triggers tools when the response is a proper structured tool call, not JSON inside content. Make sure your prompt or response format isn’t forcing text/JSON mode and that the tool name matches exactly. Are you using JSON mode or a custom system prompt that could be causing this? @Jessica
j
we aren't in JSON mode, wasn't aware that's something we could configure here. @Jarrah do you have a top of mind example on how a system prompt could cause this? or the right way to call a tool
thank you by the way for responding
j
Yep, this usually comes from the system prompt nudging the model to “output JSON” or explain actions, instead of letting it emit a native tool call. The correct approach is: don’t ask the model to format tool calls at all , just define the tool schema and let the model decide when to call it via tool_calls/function_call. Any instruction like “return JSON”, “wrap output”, or “respond with an object” can silently break tool invocation. If you want, I’m happy to walk you through a clean example and help debug this live together would that work for you? @Jessica
c
It appears that the tool is being called, but its just the response from the tool that needs to be adjusted to this format (also needs to be "content-type/JSON" Documentation Link: Tool Call Response Format:
Copy code
{
  "results": [
    {
      "toolCallId": "X",
      "result": "Y"
    }
  ]
}
j
hi Kyle how can you tell? from my end it looks like the tool isn't called at all, because OpenAI's format's incorrect or Vapi isn't interpreting it correctly as a tool call I double checked this is returned in results array format. we also never change the tool response (it's static) so that wouldn't explain why it works most of the time
@kyle
c
Hey Jessica, I see the issue now. The tool and parameters were actually just spoken and not executed the first time but then executed later. My mistake. What we recommend is adjusting your step 2 in your assistant prompt to be a little more clear:
Copy code
... After they confirm the number is correct, immediately call the 'rest-api' tool with the toolConfigName: SearchPolicyPhoneAPI ...
Also you can add to your prompt to call the tools silently if you don't have any tool messages iterated like
request-start
etc. You can even remove the
request-start
message from the
rest-api
tool instead of having an empty one. That might also help with this issue. Run some tests and let us know the results.