Custom Tool Integration Issue - Availability Data ...
# support
t
Hi Vapi Team, We're experiencing an issue with our custom tool integration for checking availability. Our tool returns accurate availability data, but the voice agent doesn't seem to be interpreting it correctly. Specifics: - We have a Supabase Edge Function at
https://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!
v
Your JSON response format needs to follow Vapi's expected structure. Try this format instead:
Copy code
json
{
  "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)
t
@Vapi Support Bot , We've implemented the exact response format you recommended for our custom tool: ```json { "results": [ { "toolCallId": "call_2tw6DwIC9l3UZfFn5Hi0vDRI", "result": "2025-05-10 is FULLY BOOKED. There are existing appointments blocking the entire business day (6:00 AM to 9:00 PM)." } ] } Our logs confirm this is being sent when Vapi calls our endpoint, but the voice agent still doesn't understand that dates are booked. It continues to suggest fully booked times. Here's our current configuration: Supabase Edge Function: https://iskmolgxmuiuvpwaosrc.supabase.co/functions/v1/jobber-availability Tool Definition: js CopyInsert { type: "function", async: true, function: { name: "check_availability", // parameters definition... }, server: { url:
${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?
v
Try verifying your endpoint with this cURL command to ensure it's responding correctly:
Copy code
bash
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)
t
@Vapi Support Bot We've diagnosed an issue with the jobber-availability endpoint responding to Vapi tool calls. Direct API testing confirms the endpoint works correctly with proper parameters but requires specific input formatting. Test Results Initial Test: Failed - Missing required parameters Request included only date parameter Error: {"error":"Missing required parameters (startDate, endDate)"} Second Test: Failed - Missing tenant ID Request included startDate and endDate Error: {"error":"No tenant ID provided","details":{}} Successful Test: Passed - All required parameters included Request included startDate, endDate, and tenantId Response: Properly formatted JSON with toolCallId matching request ID Working Request Format json CopyInsert { "message": { "toolCallList": [ { "id": "test_id_123", "function": { "name": "check_availability", "arguments": { "startDate": "2025-05-10", "endDate": "2025-05-10", "tenantId": "e7a42170-2661-4091-a495-e1598607ee97" } } } ] } } Required Parameters startDate: YYYY-MM-DD format endDate: YYYY-MM-DD format tenantId: Valid UUID for tenant authentication The endpoint URL is: https://iskmolgxmuiuvpwaosrc.supabase.co/functions/v1/jobber-availability
v
Update your tool definition to include all required parameters in the function schema:
Copy code
javascript
{
  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)
t
@Vapi Support Bot that's not the issue I'm interested in it seems that we're sending something to the Vapi server but it's not reading it how do I make sure it reads it? is there a correct link i.e. there is a tool call where the agent should get feedback, how should that feedback be sent?
v
Ensure your custom tool sends feedback in this exact format:
Copy code
json
{
  "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)
k
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!