Client Nexus
12/16/2025, 5:24 PMAI Evy
12/16/2025, 5:24 PMAI Evy
12/16/2025, 5:24 PM{{current_time}} dynamic variable in your prompt before triggering the availability check function. [(1) ]()
The LLM doesn't inherently know what time it is, which causes it to send requests for past time slots. When this happens, the cal.com integration returns errors like {"error":"Time range is in the past"}.
How to fix this:
1. Include {{current_time}} in your prompt before both calendar functions (check availability and book appointment) .
2. Update your prompt to instruct the agent to only offer slots after the current time. For example, you could add something like:
- "Before checking availability, note the current time is {{current_time}}. Only offer time slots that are after this time."
3. Ask for timezone before checking availability and booking to ensure consistency.
This way, the LLM will be aware of the actual current time and won't suggest or check for slots that have already passed.AI Evy
12/16/2025, 5:24 PMAI Evy
12/16/2025, 5:24 PMClient Nexus
12/16/2025, 6:44 PMAI Evy
12/16/2025, 6:44 PMAI Evy
12/16/2025, 6:44 PMAI Evy
12/16/2025, 6:44 PMAI Evy
12/16/2025, 6:44 PMClient Nexus
12/16/2025, 6:45 PMAI Evy
12/16/2025, 6:45 PMAI Evy
12/16/2025, 6:45 PM2025-09-24T07:00:00-04:00) , the LLM may incorrectly calculate the day of the week. To help with this, you can use {{current_calendar_[timezone]}} in your prompt to provide the AI with the correct calendar for the next 14 days in your timezone.
### 2. Recommended Pattern for Appointment Tools
The sources suggest ensuring timezone settings are configured correctly in both Cal.com and the Retell dashboard. [(2) ]() [(3) ]() For the native Cal.com integration, you specify the timezone in the tool configuration:
json
{
"type": "book_appointment_cal",
"name": "book_appointment",
"description": "Book an annual check up.",
"cal_api_key": "cal_live_xxxxxxxxxxxx",
"event_type_id": 60444,
"timezone": "America/Los_Angeles"
}AI Evy
12/16/2025, 6:45 PM{{current_calendar_[timezone]}} in your prompt. [(1) ]()
### 6. Failure Loop Prevention
I don't have documentation on a Retell-specific mechanism to force the agent to only offer returned available_alternative_slots. This would typically be handled through prompt engineering—explicitly instructing the agent to only present the returned options and not re-call availability or invent tAI Evy
12/16/2025, 6:45 PMAI Evy
12/16/2025, 6:45 PMAI Evy
12/16/2025, 6:45 PMClient Nexus
12/16/2025, 6:47 PMAI Evy
12/16/2025, 6:47 PMAI Evy
12/16/2025, 6:48 PMAI Evy
12/16/2025, 6:48 PMAI Evy
12/16/2025, 6:48 PMClient Nexus
12/17/2025, 11:22 AMAI Evy
12/17/2025, 11:22 AMAI Evy
12/17/2025, 11:22 AMtypescript
{
type: "function",
function: {
name: "end_call",
description: "End the call only when user explicitly requests it.",
parameters: {
type: "object",
properties: {
message: {
type: "string",
description: "The message you will say before ending the call with the customer.",
},
},
required: ["message"],
},
},
}
[(2) ]()
The loop happens because the LLM isn't recognizing "bye" as a trigger to invoke the end_call function—it's just responding conversationally. Adding explicit termination conditions to your prompt should resolve this.AI Evy
12/17/2025, 11:22 AMAI Evy
12/17/2025, 11:22 AM