https://retellai.com/?utm_source=discord&utm_medium=seo logo
my agent keeps calling one of our book appointment...
# ❓・ai-evy-support
g
@AI Evy my agent keeps calling one of our book appointment functions with no arguments, leading to no appointment being booked and a lot of backend issues. call_c4816cdf1b96c0f417f65588a27 Why might this be happening?
a
Thanks for tagging me @George ‼. I'll look through relevant sources and get back to you shortly.
### Answer There are a few common reasons why your agent might be calling the book appointment function with empty or missing arguments: 1. Prompting Issue The LLM decides when to call functions based on conversation context and extracts required information from the conversation. [(1) ]() If your prompt doesn't explicitly instruct the agent when to call the function, it may invoke it prematurely before collecting the necessary data. It's best to include in the prompt explicitly when to invoke the function. For example: [(2) ]()
Copy code
When user selected a slot, please book the appointment by calling the `book_appointment` function.
2. Multi-step confirmation missing For booking flows, you should define clear state transitions that confirm data before calling the function: [(3) ]()
Copy code
3. Confirm the date, time, and timezone selected by user: "Just to confirm, you want to book the appointment at ...". Make sure this is a time from the available slots.
4. Once confirmed, call function book_appointment to book the appointment.
3. Live call vs. test mode discrepancy There have been reports of booking functions receiving incorrect or missing data during live voice calls even when chat tests work correctly—particularly with fields like
email
being blank or
time
not being properly formatted. [(4) ]() Recommendations: - Review your prompt to ensure it explicitly states the conditions under which the booking function should be called - Add a confirmation step before the function is invoked - If using Conversation Flow, ensure "Wait for Result" is enabled on the function node so the agent waits for proper data collection before transitioning [(5) ]() Would you be able to share your function parameters and the relevant prompt section? That would help narrow down the issue further.
​ To learn more, see the sources I considered: [[1] Function Calling Overview](https://docs.retellai.com/build/single-multi-prompt/function-calling) [[2] Book Calendar](https://docs.retellai.com/build/book-calendar) [[3] Build a multi-prompt agent](https://docs.retellai.com/build/single-multi-prompt/write-multi-prompt) [[4] Cal.com Booking Fails from Retell Voice Agent (Live Call) due to API Receiving Incorrect Data](https://discord.com/channels/1186424376300679209/1415172353498943549) [[5] Function Node Overview](https://docs.retellai.com/build/conversation-flow/function-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
g
@User The prompting and function calls are not the issue, the agent transistion between nodes and calls the functions correcty. How ever when calling the function Retell is sending no args through the webhook.
@AI Evy The prompting and function calls are not the issue, the agent transistion between nodes and calls the functions correcty. How ever when calling the function Retell is sending no args through the webhook
a
Thanks for the follow-up, @George ‼. I'll get back to you soon.
### Answer --- If your agent is transitioning correctly and calling the function at the right time, but Retell is sending empty
args
in the webhook request, here are a few things to check: 1. Verify your parameter schema format For custom functions, parameters must be defined using valid JSON schema format. A common mistake is not adding
"type": "object"
to the top level of the JSON schema. [(1) ]() [(2) ]() Example of correct parameter schema:
Copy code
json
{
  "type": "object",
  "required": [
    "order_id"
  ],
  "properties": {
    "name": {
      "type": "object",
      "description": "",
      "properties": {
        "first_name": {
          "type": "string",
          "description": "User first name"
        },
        "last_name": {
          "type": "string",
          "const": "{{last_name}}"
        }
      }
    },
    "order_id": {
      "type": "number",
      "const": 1234
    }
  }
}
2. Check HTTP method Parameters in the request body are only available for POST, PATCH, and PUT requests. If you're using GET or DELETE, the body will be empty. 3. Inspect the actual webhook request When Retell sends the request to your endpoint, the body (for POST, PUT, PATCH) should contain: - `name`: the name of the custom function - `call`: the call object with context and real-time transcript - `args`: the arguments for the custom function as a JSON object 4. Check call detail logs Since you have the call ID (
call_c4816cdf1b96c0f417f65588a27
) , I'd recommend checking the call detail logs in your dashboard to see exactly what Retell sent. This can help identify if the issue is on the Retell side or in how your endpoint is receiving/parsing the request. If your schema is valid and you're using POST, this may be a platform-level issue worth escalating to Retell support with your call ID and function configuration.
​ To learn more, see the sources I considered: [[1] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[2] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.