https://retellai.com/?utm_source=discord&utm_medium=seo logo
my ai agent is trying to check availability for to...
# ❓・ai-evy-support
c
@AI Evy my ai agent is trying to check availability for todays date, what do i need to do so she can check times avaiable only after a certain period? like example today is already late morning, but is she checking today morning times, instead of go or to afternoon or to another day
a
Thanks for tagging me @Client Nexus. I'll look through relevant sources and get back to you shortly.
### Answer --- To prevent your agent from checking availability for times that have already passed (like morning slots when it's already late morning) , you need to use the
{{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.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Urgent: Cal.com Booked on different day - Potential Service Disruption with multiple issue.](https://discord.com/channels/1186424376300679209/1423174290458808381) ​
c
@AI Evy our email is basically asking all info at once to confirm email phone and name, this type of issues are prompt issues or sset up issues in webhooks and etc?
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer --- This is typically a prompt issue, not a webhook or setup issue. When the agent asks for all information at once (email, phone, name) instead of collecting them one at a time in a conversational flow, it usually means the prompt instructions are too complex or not written in natural language that the LLM can follow properly. [(1) ]() How to fix this: 1. Simplify your prompt – Write instructions in clear, natural language. Instead of listing all fields to collect at once, structure your prompt to guide the agent step-by-step through each piece of information. 2. Use LLM States – If you need a more structured approach, consider using LLM States to split the conversation into distinct stages (e.g., State 1: collect name, State 2: collect phone, State 3: collect email) . This reduces context drift and helps the agent follow the intended flow. 3. Use Conversation Flow – The visual node-based editor lets you design guided, multi-path dialogues with conditional transitions, which can help ensure the agent collects information in the correct order. Webhooks handle the data transfer after collection—they send the collected info to external systems. [(2) ]() [(3) ]() If the agent is collecting everything at once, the issue is in how the agent is prompted to ask, not in how the data is sent afterward. ---
​ To learn more, see the sources I considered: [[1] Prompt](https://discord.com/channels/1186424376300679209/1277004188437577749) [[2] Webhook](https://www.retellai.com/glossary/webhook) [[3] Retell AI Webhooks | AI Voice Agents With Live Data | Retell AI](https://www.retellai.com/blog/retell-ai-webhooks-feature) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Timezone handling: When a tool returns ["17:00","17:45"] plus timezone:"America/Los_Angeles", does Retell ever auto-convert those times for speech? Or does it always treat them as “already-local” strings? Recommended pattern: For appointment tools, do you recommend returning: A) localized display strings only (e.g. “9:00 AM”), or B) machine times (UTC/ISO) + a separate “display” field, or C) always ISO 8601 with timezone offset (e.g. 2025-12-17T09:00:00-08:00)? Tool argument constraints: Can Retell be forced to echo back an enum value exactly (e.g. the time argument must equal one of available_slots) reliably, or does the model sometimes “normalize” times anyway? Best practice for booking: Should the booking tool accept an absolute timestamp (ISO string) instead of HH:mm to avoid AM/PM and timezone ambiguity? Speech formatting: If we return UTC slots, is there an official way in Retell to have the agent speak them in the caller’s timezone without the model doing the math (e.g. a built-in formatter / template variable)? Failure loop prevention: When a tool returns available_alternative_slots, is there a Retell-supported mechanism to force the agent to only offer those (vs re-calling availability / inventing a new time)?
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer --- Based on the available sources, I can address some of your questions, though not all have explicit documentation: ### 1. Timezone Handling Retell does not auto-convert times for speech. The LLM treats returned values as strings and speaks them as-is. [(1) ]() When times are returned in ISO format (e.g.,
2025-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:
Copy code
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"
}
[(4) ]() [(5) ]() Given the documented issues with ISO format day-of-week calculations [(1) ]() , returning localized display strings (Option A) or ISO 8601 with timezone offset (Option C) alongside clear prompt instructions appears to be the safer approach. ### 3. Tool Argument Constraints / Enum Echo I don't have explicit documentation on whether Retell can force the model to echo back an enum value exactly. LLMs may sometimes "normalize" or rephrase values. Using Structured Output (tool_call_strict_mode) can help ensure function arguments follow predefined schemas more reliably. [(6) ]() ### 4. Best Practice for Booking The native Cal.com integration accepts a timezone parameter in the tool configuration. [(4) ]() [(5) ]() For custom tools, accepting an absolute ISO timestamp would reduce AM/PM and timezone ambiguity, though this isn't explicitly prescribed in the documentation. ### 5. Speech Formatting (UTC to Caller's Timezone) There is no documented built-in formatter that automatically converts UTC to the caller's timezone for speech. The recommendation is to use
{{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 t
imes. --- Check out these potentially useful sources for more details: - [AI Appointment Scheduling with Voice AI Booking Assistant]() - [Configure LLM Options]() - [Create Retell LLM]() Would you like a general answer on any of the questions I couldn't fully address from the sources?
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Returning Incorrect DAY when in ISO Format.](https://discord.com/channels/1186424376300679209/1418668209443180675) [[2] AI Appointment Scheduling with Voice AI Booking Assistant](https://www.retellai.com/features/book-appointments) [[3] Discord message from @sanava.ai on 2024-11-06](https://discord.com/channels/1186424376300679209/1294891368505937952/1303839533699170424) [[4] Get Retell LLM](https://docs.retellai.com/api-references/get-retell-llm) [[5] Create Retell LLM](https://docs.retellai.com/api-references/create-retell-llm) [[6] Configure LLM Options](https://docs.retellai.com/build/llm-options) ​
c
@AI Evy Should we return times in 12-hour format with AM/PM (e.g., '9:00 AM') or 24-hour format (e.g., '09:00') for best LLM handling? Does the LLM speak '09:00' as 'nine o'clock' or 'oh-nine-hundred'?"
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer I don't have explicit documentation on whether Retell recommends 12-hour vs 24-hour format for time returns, or how the LLM/TTS specifically pronounces "09:00" vs "9:00 AM." The LLM treats returned values as strings and the TTS converts text to speech, but the exact pronunciation behavior (whether "09:00" becomes "nine o'clock" or "oh-nine-hundred") isn't specified in the available sources. Practical recommendation: Returning 12-hour format with AM/PM (e.g., "9:00 AM") is generally safer because: - It removes ambiguity for the LLM when speaking times - It matches natural conversational patterns - It avoids potential TTS pronunciation inconsistencies with leading zeros Would you like a general answer based on common LLM/TTS behavior patterns? Check out these potentially useful sources: - [Configure LLM Options]() - [Dynamic Variables]()
message has been deleted
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy sometimes we just get in a loop in the call i say bye she say bye and she dont hang up, i have a end call set up in the custom functions but lok like she is not calling why
a
Thanks for the follow-up, @Client Nexus. I'll get back to you soon.
### Answer --- The issue is likely that your prompt doesn't explicitly instruct the agent when to call the end_call function. By default, the agent won't end the call automatically—you need to configure specific termination conditions. [(1) ]() To fix this: 1. Update your prompt to include explicit instructions like: > "If the user says 'thank you', 'goodbye', or 'bye', use the end_call tool to terminate the conversation." 2. Verify the End Call tool is added in the tools section of your agent configuration. 3. Check your function definition if using a custom LLM. The end_call function should be defined with a clear description:
Copy code
typescript
{
  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.
​ To learn more, see the sources I considered: [[1] End call](https://docs.retellai.com/build/single-multi-prompt/end-call) [[2] Integrate Function Calling](https://docs.retellai.com/integrate-llm/integrate-function-calling) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.