Vapi Agent not picking up webhook response.
# support
a
I am making a function call and am correctly getting a response back via webhooks. The issue is that the agent keeps saying result not found. When I manually test the function tools, you can see that I get a result back. But, the agent never relays that to the caller. https://cdn.discordapp.com/attachments/1361016365045121245/1361016365817004275/image.png?ex=67fd38c4&is=67fbe744&hm=b0ee56ad337eb22f33879de572b7bf068a6dac81bc53336508e15ed15ae6cde5&
v
Hi there! 👋 I see you're having an issue with your Vapi Agent not relaying webhook responses to the caller. Based on the screenshot you shared, I can see that your webhook is correctly receiving a response with a result, but the agent isn't relaying this information to the caller. Let me help troubleshoot this issue! Looking at your webhook response, I've identified a few potential issues that might be causing this problem: ### Response Format Issues The most common reason for this issue is incorrect response formatting. According to the [troubleshooting information](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339900285727805513) I found, the correct format for tool call responses should be:
Copy code
json
{
    "results": [
        {
            "toolCallId": "X",
            "result": "Y"
        }
    ]
}
In your screenshot, I notice your response has a
results
object rather than a
results
array. The correct format should have
results
as an array containing objects with
toolCallId
and
result
fields. ### ToolCallId Matching Another critical aspect is ensuring the
toolCallId
in your response exactly matches the one sent by Vapi in the initial request. According to [documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325000684231196775), if there's a mismatch, Vapi won't be able to associate the response with the correct tool call. I notice in your screenshot that the
toolCallId
appears to be truncated ("dcfbb703-76fb-47f9-98ed-b218410..."). Make sure you're using the complete
toolCallId
without any modifications. ### Debugging Steps Here are some steps you can take to debug this issue: 1. **Check JSON Format**: Ensure your webhook response follows the exact format expected by Vapi, with
results
as an array. 2. **Verify Content-Type**: Make sure the content-type of your response is set to
application/json
.
3. **Check Complete ToolCallId**: Ensure you're using the complete
toolCallId
from the initial request. 4. **Inspect Logs**: Look at your Vapi logs to see if there are any error messages related to the webhook response. 5. **Test with a Simplified Response**: Try a simplified response format to see if that works:
Copy code
json
   {
     "results": [
       {
         "toolCallId": "dcfbb703-76fb-47f9-98ed-b218410...",
         "result": "The merchant name for that transaction"
       }
     ]
   }
Would you like me to help you troubleshoot any specific part of this issue further? Sources: - [https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339900285727805513](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1339900285727805513) - [https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325000684231196775](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1325000684231196775)
a
Nvm was able to figure it out. I had the incorrect toolcallid
v
Message marked as helpful by @azaylair! 🎉
k
Marking this ticket as Solved ✅