Nidhi Sharma
04/03/2025, 6:02 AMVapi Support Bot
04/03/2025, 6:03 AMWhen a user wants to book an appointment:
1. ALWAYS use the checkAvailableSlots tool first to verify availability
2. ONLY use the bookappointmentTool if slots are available
3. If no slots are available, inform the user and suggest alternatives
## 2. Access Tool Response Results
To make decisions based on the checkAvailableSlots tool response, your assistant needs to access the result. The tool response will be in this format:
json
{
"results": [
{
"toolCallId": "call_123456789",
"result": "The following timeslots are available: 2025-04-04T14:00:00-05:00,2025-04-04T14:30:00-05:00"
}
]
}
Your assistant can then parse this response to determine if slots are available before proceeding to booking.
## 3. Implement Server-Side Logic
For more robust control, you can implement conditional logic on your server. According to [Vapi's documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333245023319494707), when Vapi sends a server request to your server, you can analyze the payload from the checkAvailableSlots tool and conditionally trigger the bookappointmentTool based on the results.
## 4. Example Workflow
Here's a typical workflow for appointment booking:
1. Collect user's preferred date and timeVapi Support Bot
04/03/2025, 6:03 AMcheckAvailableSlots tool
3. If slots are available, proceed to call the bookappointmentTool
4. If no slots are available, inform the user and suggest alternatives
This approach is mentioned in the [appointment setter documentation](https://docs.vapi.ai/prompting-guide#appointment-setter).
Would you like me to elaborate on any specific part of this process? Or do you need help with implementing any of these approaches?
Sources:
- [Vapi documentation](https://docs.vapi.ai/prompting-guide)
- [Discord discussion](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1333245023319494707)
- [Appointment setter documentation](https://docs.vapi.ai/prompting-guide#appointment-setter)Vapi Support Bot
04/03/2025, 9:00 AMKyle
04/06/2025, 9:16 AM