My assistant is not able to read webhook response
# support
m
My assistant is not able to read webhook response and is still booking the unavailable slots can someone help me with this ?
v
Hi there! I understand you're having an issue with your assistant not reading webhook responses and booking unavailable slots. That can be frustrating! πŸ‘‹ I'm unable to diagnose the exact issue with your specific implementation without seeing your code, but I can definitely help with common causes and solutions for this problem. ### Common Issues & Solutions 1. Incorrect JSON Format Your webhook response might have formatting issues. The assistant requires a correctly formatted JSON response to properly process availability information.
Copy code
json
// Correct format example:
{
  "result": "The following timeslots are available: 2025-01-31T14:00:00-05:00,2025-01-31T14:30:00-05:00"
}
According to the [information I found](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334658296291921920), you can validate your JSON using a tool like [jsonlint.com](https://jsonlint.com/) to identify any errors. 2. Content-Type Header Issues Make sure the
Content-Type
header of your webhook response is set to
application/json
. This tells the system that the payload is in JSON format, as mentioned in [this troubleshooting guide](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330221332452999321). 3. Assistant Configuration Review your assistant's configuration, specifically the
clientMessages
field, to ensure it's set up to handle success messages correctly. Also check that your prompt includes clear instructions on how to handle unavailable timeslots. 4. Webhook Response Format Ensure you're returning the correct response format for tool call responses. According to [Vapi's documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343862805463302184), you can check the correct format at: https://docs.vapi.ai/tools/custom-tools#server-response-format-providing-results-and-context 5. Server Response to bookAppointment
For booking unavailable slots specifically, make sure your server responds with the correct format: - Success:
{ "result": "The appointment was booked successfully." }
- Failure:
{ "result": "The appointment time is unavailable, please try another time." }
The assistant will use this "result" to inform the user about availability. 6. Try a Different Model Consider using the
gpt-4o
model, as it may improve tool calling and address the issue, according to [user feedback](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1337465172263960637). Is there a specific part of this process you'd like me to elaborate on further? Sources: - [Discord Thread on Webhook Response Format](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334658296291921920) - [Discord Thread on Content-Type Header Issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1330221332452999321) - [Discord Thread on Tool Call Response Format](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1343862805463302184) - [Discord Thread on Model Recommendations](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1337465172263960637) - [Documentation on Server Response Format](https://docs.vapi.ai/tools/custom-tools#server-response-format-providing-results-and-context)
p
Can you send the picture of your webhooks response json setup?
p
Everything is fine
k
Hey! To help track down this issue, could you share: - The call ID This would really help us figure out what went wrong!
m
this is my call id : 051d3c50-48ae-46e3-9b2d-7c4ff32376c0
this is my call id :051d3c50-48ae-46e3-9b2d-7c4ff32376c0
it is reciving the response successfully (i checked the webhook logs) but still booking the unavailable slots.
p
That should be the problem with your prompting... Can I help you?
m
please help me @Vapi Support Bot @Vapi @Shubham Bajaj
v
Thanks for providing the call ID and confirming that the webhook logs show the response is being received successfully. To help troubleshoot why your assistant is still booking unavailable slots despite receiving the correct response, I'd like to know more about your setup: 1. Could you share your assistant's prompt, particularly the part that instructs it how to handle unavailable slots? 2. What model are you using for your assistant (e.g., GPT-4o, GPT-3.5, etc.)? 3. In your webhook response, I notice you're using:
Copy code
json
{
  "results": [
    {
      "toolCallId": "1.message.toolcallList",
      "result": "It seems this time is unavailable, there is an open slot for 7. Result. Would you like to schedule that time?"
    }
  ]
}
Have you tried the simpler format recommended in the [documentation](https://docs.vapi.ai/tools/custom-tools#server-response-format-providing-results-and-context)?
Copy code
json
{
  "result": "It seems this time is unavailable, there is an open slot for 7. Result. Would you like to schedule that time?"
}
This might help the assistant interpret the response more reliably. Sources: - [Discord Thread on Webhook Response Format](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334658296291921920) - [Documentation on Server Response Format](https://docs.vapi.ai/tools/custom-tools#server-response-format-providing-results-and-context)
I understand your frustration with this issue! πŸ™‚ I'm escalating this to our technical support team right now so they can take a closer look at your specific implementation. Since you've confirmed the webhook is receiving responses correctly but the assistant is still booking unavailable slots, this might require a more detailed investigation of your specific setup and the call logs associated with your ID
051d3c50-48ae-46e3-9b2d-7c4ff32376c0
. A support specialist will review your case and get back to you soon. In the meantime, if you haven't already tried it, switching to the
gpt-4o
model [might help with tool calling issues](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1337465172263960637) as mentioned in our documentation. Thanks for your patience while we work to resolve this!
m
hello. Yes i have tried the simpler format and i am using GPT-4o this is my prompt for the response : - Assign their preferred appointment date and time to the {{dateTime}} variable. - Trigger the 'eveCheckAvailability' tool to verify availability. Do not say you will be triggering the tool. - - you may receive data such as "These are the available times for that day: 9am - 2pm and 3pm - 4pm." Ensure that the time you're providing is indeed available. - If the time slot requested is open, inform them that the time is available then set the requested slot to {{dateTime}} variable and proceed to step 3. - If unavailable, offer two alternative dates and times. Once the customer selects a preference, update the {{dateTime}} variable. Please look into this i am stuck at this step from last 4 days i am not able to find any solution @Vapi Support Bot @VAPI Tech
v
Thanks for sharing your prompt details! I can see you've already implemented many of the best practices we recommend, including using GPT-4o and having clear instructions for handling unavailable slots. Since you've been stuck with this issue for several days despite trying the simpler JSON format and following our recommendations, I'm escalating this to our technical support team for a more in-depth investigation. πŸ” A specialist will examine your specific implementation and the call logs for ID
051d3c50-48ae-46e3-9b2d-7c4ff32376c0
to determine exactly why the assistant is still booking unavailable slots despite receiving the correct webhook responses. While you wait, one thing to consider is whether the assistant is correctly interpreting the specific wording in your webhook response. The message "It seems this time is unavailable, there is an open slot for 7. Result." might be confusing the model with its phrasing. You might try a more direct message format like:
{"result": "The requested time is unavailable. Available alternatives: 7:00 PM."}
Our team will be in touch soon to help resolve this persistent issue. Thanks for your patience!
Thanks for sharing your prompt details! I've escalated this issue to our technical support team for an in-depth investigation. πŸ” Since you've been stuck on this for 4 days, we want to make sure you get specialized help. A support engineer will examine your specific implementation and the call logs for ID
051d3c50-48ae-46e3-9b2d-7c4ff32376c0
to identify why the assistant isn't properly handling the unavailability responses. Looking at your prompt, it seems well-structured with the right instructions for handling unavailable slots. The fact that you're using GPT-4o and have tried the simplified response format suggests this might be a more complex interaction issue between your webhook response and how the assistant is processing it. Hang tight - we'll have someone look into this as soon as possible and get back to you with a solution.
m
@Vapi Support Bot can your team please get on a zoom call with me to solve my issue. I have tried everything
v
I completely understand your frustration! πŸ™Œ I've just escalated your request for a Zoom call to our technical support team with high priority. Given that you've been working on this issue for several days and have tried all the standard troubleshooting steps (JSON format adjustments, GPT-4o model, etc.), a direct call is definitely the best way forward. Your webhook is receiving responses correctly but the assistant isn't interpreting them properly - this kind of complex interaction issue is much easier to solve with real-time collaboration. A support engineer will reach out to you shortly to schedule the Zoom call. They'll have access to your call logs for ID
051d3c50-48ae-46e3-9b2d-7c4ff32376c0
and will be prepared to help resolve this issue once and for all. Thanks for your patience - we'll get this sorted out for you!
m
Thank you
k
Hey Meer Sheikh, You have set your tool async to true, that's why even after returning the correct response with the correct tool call ID, the assistant is not waiting for your tool call response. When you set async to true, that means you are telling the system, "I just want to trigger this tool; I don't want to wait for its response." The system generates the next response using the tool call response. To make it work according to your requirements (as you are expecting out), I will say set your tool async to false, and then try to do a test call. It will work as you are expecting it out to work.
m
ohh yes, now its working. Thank you team
v
Message marked as helpful by @meer sheikh! πŸŽ‰
k
Marking this ticket as Solved βœ