Tools - calling the API but not providing the requ...
# support
v
Hi @KMlearning84, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Update Assistant]() * [List Calls]() * [Get Call]() * [List Assistants]() -----------------------------
### Answer It seems like there might be an issue with how the payload is structured or how your server handles incoming requests from Vapi. Here are a few suggestions and steps you can take to troubleshoot and resolve this issue: 1. **Verify Payload Configuration**: Ensure that the payload configured in your Vapi assistant's tool settings is correctly structured according to your endpoint's expectations. You might need to adapt the payload to match the expected parameters of your server endpoint. For detailed guidance on how to configure and adapt tool payloads, refer to the Tools Calling documentation [(1)]() . 2. **Check Server Endpoint**: Verify that your server endpoint is correctly parsing the incoming requests. It should be able to read the parameters sent by Vapi and process them accordingly. Make sure that your server logs incoming requests to help identify what data is being received. 3. **Server Error Handling**: Ensure that your server has proper error handling to provide more descriptive error messages. This can help in diagnosing issues related to "cannot schedule" errors, which may be due to server-side constraints or misconfigurations. 4. **Asynchronous Behavior**: If your tool is set to function asynchronously (i.e., it does not wait for a response before moving forward), consider switching this to a synchronous behavior temporarily to see if the response handling changes the outcome . Here's a generic example of how you might structure a function tool in your Vapi configuration:
Copy code
json
{
    "type": "function",
    "messages": [
        {
            "type": "request-start",
            "content": "Initiating request..."
        }
    ],
    "function": {
        "name": "your_function_name",
        "parameters": {
            "type": "object",
            "properties": {
                "param1": {"type": "string"},
                "param2": {"type": "number"}
            }
        },
        "description": "Description of your function."
    },
    "async": false,
    "server": {
        "url": "https://your-endpoint.com/api"
    }
}
Ensure that the
async
property and
server.url
are set according to your specific needs and server configuration.
Got it. Tagging @User for additional help.
k
This is my tool function:
"tools": [ { "type": "function", "messages": [ { "type": "request-start", "content": "Let me check the available times. Please wait..." }, { "type": "request-complete", "content": "Your callback has been scheduled." }, { "type": "request-failed", "content": "I couldn't schedule the callback right now. Please try again later." }, { "type": "request-response-delayed", "content": "It appears there is some delay in scheduling the callback.", "timingMilliseconds": 2000 } ], "function": { "name": "getCallbackDateTime", "parameters": { "type": "object", "properties": { "datetime": { "type": "string", "description": "The date and time the user wants the callback in ISO format." } }, "required": ["datetime"] }, "description": "This function captures the date and time the user would like a callback during a call. It validates the input, saves the information in the database, and schedules the callback. If successful, it returns a confirmation message to the user." }, "async": false, "server": { "url": "https://us-central1-candid-i-dcb95.cloudfunctions.net/testApiCall" } } ],
s
Are you sending the data in right format?
Send the latest call_id. I will take a look at it.
k
fixed we were sending the wrong format. Thanks
2 Views