David
05/05/2025, 4:54 AMhttps://iskmolgxmuiuvpwaosrc.supabase.co/functions/v1/jobber-availability
- The function successfully queries our scheduling system (Jobber) and returns availability data
- Our logs show that we're correctly sending data indicating days that are fully booked
- However, the voice agent still offers those fully booked time slots to callers
What we're sending to Vapi:
```json
{
"result": {
"content": "2025-05-10 is FULLY BOOKED. There are existing appointments blocking the entire business day (6:00 AM to 9:00 PM).",
"additionalContext": "{\"startDate\":\"2025-05-10\",\"endDate\":\"2025-05-10\",\"scheduledItems\":[...],\"availability\":{\"date\":\"2025-05-10\",\"busy\":[...]},\"availability_summary\":\"2025-05-10 is FULLY BOOKED\",\"has_availability\":false}"
}
}
Questions:
Is there a specific format we need to use for availability data that the voice agent will understand?
Should we be setting any specific fields in our response to indicate fully booked times?
Is there any documentation available for how to structure custom tool responses for scheduling functionality?
Does the voice agent need additional instructions/prompting to process our availability data properly?
We've set our tool to async: true to match our voice agent configuration.
Any guidance would be greatly appreciated!Vapi Support Bot
05/05/2025, 4:56 AMjson
{
"results": [
{
"toolCallId": "call_ID_FROM_REQUEST",
"result": "2025-05-10 is FULLY BOOKED. There are existing appointments blocking the entire business day (6:00 AM to 9:00 PM)."
}
]
}
The toolCallId must match the ID from Vapi's request, and the result should be a simple string without nested JSON objects.
Sources:
- [Vapi Custom Tool Integration Documentation](https://docs.vapi.ai/tools-calling)
- [Discord Channel Discussion](https://discord.com/channels/1211482211119796234/1325000684231196775)
- [Discord Channel Discussion](https://discord.com/channels/1211482211119796234/1342176467714572400)David
05/05/2025, 5:43 AM${SUPABASE_FUNCTIONS_URL}/jobber-availability,
headers: {
'Content-Type': 'application/json'
}
}
}
Questions:
Is there a specific URL path or endpoint format we should be using?
Could there be a routing issue between our function and Vapi?
Do we need to register our tool on the Vapi dashboard in addition to defining it in code?
Do you have a sample cURL command so we can verify our endpoint is responding correctly?
Can you help us diagnose why the voice agent isn't recognizing our "FULLY BOOKED" message?Vapi Support Bot
05/05/2025, 5:44 AMbash
curl -X POST https://iskmolgxmuiuvpwaosrc.supabase.co/functions/v1/jobber-availability \
-H "Content-Type: application/json" \
-d '{
"message": {
"toolCallList": [
{
"id": "test_id_123",
"function": {
"name": "check_availability",
"arguments": {
"date": "2025-05-10"
}
}
}
]
}
}'
The response should include the exact toolCallId from the request and a single-line string result.
Source:
- [Vapi Custom Tool Integration Documentation](https://docs.vapi.ai/documentation/advanced-concepts/customization/custom-llm/custom-llm-tool-calling-integration)David
05/05/2025, 5:51 AMVapi Support Bot
05/05/2025, 5:53 AMjavascript
{
type: "function",
async: true,
function: {
name: "check_availability",
parameters: {
type: "object",
properties: {
startDate: { type: "string", description: "Start date in YYYY-MM-DD format" },
endDate: { type: "string", description: "End date in YYYY-MM-DD format" },
tenantId: { type: "string", description: "Valid UUID for tenant authentication" }
},
required: ["startDate", "endDate", "tenantId"]
}
},
// rest of your configuration...
}
Source:
- [Vapi custom tool integration troubleshooting guide](https://discord.com/channels/1211482211119796234/1334114042876264518)David
05/05/2025, 11:41 AMVapi Support Bot
05/05/2025, 11:42 AMjson
{
"results": [
{
"toolCallId": "call_ID_FROM_REQUEST",
"result": "2025-05-10 is FULLY BOOKED. There are existing appointments blocking the entire business day."
}
]
}
The toolCallId must exactly match the ID received in Vapi's request, and the result must be a single-line string (not a nested JSON object).
Sources:
- [Vapi Custom Tool Integration Documentation](https://docs.vapi.ai/tools/custom-tools)
- [Discord Channel Discussion](https://discord.com/channels/1211482211119796234/1325000684231196775)Chiranjeet Mishra
05/05/2025, 4:20 PM