KosKrit
04/06/2025, 7:39 PMVapi Support Bot
04/06/2025, 7:41 PMget_appointments
function tool during a conversation!
According to the [documentation](https://docs.vapi.ai/tools), VAPI Assistants are designed to "take actions beyond just conversation" including "accessing external data" - which is exactly what your get_appointments tool would be doing. The assistant can process the tool's response and incorporate that information into the conversation.
When your tool is called, your server needs to respond with a specific JSON format:
json
{
"results": [
{
"toolCallId": "X",
"result": "Y"
}
]
}
The toolCallId
helps the assistant match the response with the corresponding tool call, and the result
field contains the actual output (in your case, the text with all the appointments) that the assistant can then read and incorporate into the conversation.
To ensure the assistant properly reads the response:
1. Make sure your server returns the correct JSON format
2. Verify the content-type is set to application/json
3. Ensure there are no formatting issues in your JSON response
4. Double-check that the toolCallId
matches what VAPI expects
It's worth noting that some users have reported issues where assistants sometimes don't automatically relay tool responses back to the caller. If you encounter this, you might need to troubleshoot by reviewing your configuration and ensuring everything is set up correctly.
Is there anything specific about implementing this functionality that you'd like to know more about?
Sources:
- [VAPI Tools Documentation](https://docs.vapi.ai/tools)
- [Custom Tools Documentation](https://docs.vapi.ai/tools/custom-tools)
- [Tools Calling Documentation](https://docs.vapi.ai/tools-calling)Kings_big💫
04/06/2025, 7:45 PMKosKrit
04/06/2025, 7:50 PMKosKrit
04/06/2025, 8:07 PMjson
{
"results": [
{
"toolCallId": "8a0264b6-80c8-427a-8efa-5d32366f0b3f",
"results": "Appointment ID: 31\nStart: 2025-03-27 at 17:00:00\nEnd: 2025-04-06 03:49:00..."
}
]
}
json
{
"results": {
"toolCallId": "8a0264b6-80c8-427a-8efa-5d32366f0b3f",
"results": "Appointment ID: 31\nStart: 2025-03-27 at 17:00:00\nEnd: 2025-04-06 03:49:00..."
}
}
But it still doesn't read the response in conversationShubham Bajaj
04/07/2025, 7:43 AM