Format response according to Vapi's expected struc...
# support
s
Hello, I need some help. Even though I can see the response from my tool, the AI agent is not acting as if it is reading the information in the results. I'm not sure if I should use
tool_call_id
or
toolCallId
(as mentioned in the documentation). The issue is that, even when everything looks fine, the AI is not acting as if it has access to the information in the results from the tool call response. https://cdn.discordapp.com/attachments/1367842540358860852/1367842540493082796/image_1.png?ex=68160e22&is=6814bca2&hm=5daf57f1725a1be0c861f2cb9126668f7365a51be8fef609dde6a55e78f106e7& https://cdn.discordapp.com/attachments/1367842540358860852/1367842540866240545/image.png?ex=68160e23&is=6814bca3&hm=6b711caa5e4b166d3a87443187637d582d26962c1161a23c519c6862a224503b&
v
Use
toolCallId
(camel case) in your response structure. The correct format should be:
Copy code
json
{
  "results": [
    {
      "toolCallId": "call_VaJOd8ZeZgWCEHDyomyCPfwN",
      "result": "San Francisco's weather today is 62°C, partly cloudy."
    }
  ]
}
Ensure your
result
is a single-line string without line breaks, and for JSON responses, stringify the content first. Source: - [Vapi Documentation Custom Tools](https://docs.vapi.ai/tools/custom-tools)
v
Message marked as helpful by @southern_push2935! 🎉
c
It looks like you should use
toolCallId
as the correct format for your response. Make sure your server sends back the response JSON structured as:
Copy code
json
{
  "results": [
    {
      "toolCallId": "X",
      "result": "Y"
    }
  ]
}
The AI agent uses
toolCallId
to match responses with requests. Double-check that your server response matches this format and ensure there are no typos or structural differences. This should help the AI act on the gathered information correctly. If you're still having trouble, let me know.
2 Views