Can a VAPI Assistant read the response of a tool w...
# support
k
I have a get_appointments function tool that receives a text with all the appointments. Can I make the VAPI Assistant read it while on conversation?
v
Hi there! 👋 Yes, a VAPI Assistant can definitely read the response of your
get_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:
Copy code
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)
k
@KosKrit was it helpful?
k
No, It responds like it has successfully retrieved the info but when I ask about the new information it doesn't recall anything
It successfully uses the tool request function, but It still responds without any new information from the response. I checked the url and it works fine and returns a json object in the correct format. Tried with both Response Formats:
Copy code
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..."
    }
]
}
Copy code
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 conversation
s
checking if this is resolved/solved for you?