Tool doesnt accept repsonse from webhook
# support
f
Hi, I'm encountering an issue with my AI voice agent where it's not incorporating results from a webhook (via MAKE) into its responses. The webhook is successfully triggered and returns data (available slots), but the agent's answers don't reflect this information. I send the following back to Vapi via the webhook response in the body: { “results": [ { “toolCallId": ‘e8d9b2f3-6351.....’, “result": ”These are our available times: Available times on September 30, 2024: - 9am to 2pm - 3 pm to 5 pm” } ] } But the agent keeps on responding that there are no available time slots. I checked the Webhook Log in Vapi and I shows: name: "_getAvailability" (toolname) role: "tool_call_result" time: 1727637554162 result: "No result returned." toolCallId: "call_K06oDoPR5ha0KoViaPw9VDIC" secondsFromStart: 15.605 What could be causing the disconnect between the webhook results and the agent's responses? Any troubleshooting steps or configuration checks I should try?
@Vapi any ideas?
v
@Fabi It sounds like there might be a mismatch between the data your webhook is sending and what VAPI expects to receive, or there could be an issue with how VAPI is processing the webhook response. Here are a few troubleshooting steps you can try: 1. **Check the Webhook Configuration**: Ensure that the webhook URL and payload format in VAPI are correctly configured to match what MAKE is expecting and sending. 2. **Validate the Payload**: Double-check that the payload from MAKE is correctly formatted as JSON and matches the schema that VAPI expects. Pay special attention to the use of quotation marks and ensure that they are standard double quotes ("") rather than stylized or single quotes (‘’). 3. **Inspect the Tool Call ID**: Verify that the
toolCallId
in the webhook response matches the one that VAPI is expecting. If there's a mismatch, VAPI may not be able to associate the response with the correct session. 4. **Review VAPI's Processing Logic**: There might be an issue with how VAPI processes the webhook response. Ensure that the logic is set up to parse the
results
array and extract the
result
field correctly. 5. **Check for Errors**: Look for any error messages or logs in VAPI that could indicate why it's not processing the webhook response correctly. 6. **Test the Webhook Manually**: You can try sending a manual request to the webhook URL with the expected payload to see if the issue is with the sending or receiving end. 7. **Contact Support**: If you've gone through these steps and the issue persists, it may be best to contact VAPI support for further assistance. If you need help with any specific step or if you'd like me to perform an action on your behalf, please let me know!
n
From the recent office hours, I learnt that what’s in the “result” portion should only be 1 line without any newlines in it.
t
One line ? noo .. I'm sending more then that .. You should avoid the return to the line , yes .. all should be simple text .. cause /n breaks the json
{ “results": [ { “toolCallId": ‘e8d9b2f3-6351.....’, “result": ”These are our available times: Available times on September 30, 2024: 9am to 2pm and 3 pm to 5 pm” } ] } if you return this it should work
s
@Fabi try returning tool call response in single string without line breaks.
f
thanks @Shubham Bajaj and @nishad - for some reason returning the result without line breaks works! no idea why though
3 Views