Skip to Content

Resolve date

Calculate calendar dates and weekdays in the right timezone, without asking the agent to do date arithmetic.

Resolve date turns what a caller says into a Gregorian YYYY-MM-DD date. The agent extracts the day, weekday or offset; the tool calculates the date. It works in voice and text conversations, including evaluations. It does not book anything, approve a payment, or apply calling hours or holiday calendars.

Enable it

In the agent's Tools tab, choose Add tool → Resolve date. Choose a timezone mode, the start of the week, and English or Arabic spoken dates. Expand Preview a calculation to try a day offset with a fixed reference date. Preview's sample timezone is separate from the saved timezone mode.

Over the API, add this block to the agent's draft behavior, then promote and deploy through the usual version lifecycle:

{
  "behavior": {
    "system_tools": {
      "resolve_date": {
        "enabled": true,
        "timezone_mode": "custom",
        "timezone": "Asia/Riyadh",
        "week_starts_on": "sunday",
        "locale": "ar-SA"
      }
    }
  }
}

Supplying behavior replaces the whole behavior document. Merge this block with the existing settings before updating the draft. The tool is off when omitted. It needs no catalog tool ID, external endpoint, secret, or additional feature entitlement.

Choose the timezone

timezone_modeHow the timezone is chosen
organizationThe team's default timezone in Settings. This is the default mode.
customThe configured timezone, such as America/New_York.
caller{{vars.lead_timezone}} from call context; otherwise the team default. Supply known contact timezone data through this variable.
agentThe assistant supplies a required timezone argument from what the caller says. It asks for their city or timezone when unknown or ambiguous.

Timezone identifiers must be loadable IANA region names, such as Asia/Dubai, or UTC. Abbreviations such as CST, IST or EST are not accepted. The tool never infers a timezone from a phone number or the server's local clock. Invalid provided timezones fail rather than silently falling back.

In assistant mode, the timezone is required for every invocation. In other modes, it is not an argument the model can override. For example, if a caller says they mean New York time, the assistant passes America/New_York.

“Today” is the date in the selected timezone when the calculation executes. Calls that cross midnight use the new local date on their next calculation. reference_date changes where arithmetic starts, but days_from_today still compares against local today. Responses include the effective timezone and source.

Date arguments

Use one anchor: date, day_of_month with optional month and year, weekday, or today when no date anchor is supplied. All offsets are integers.

Caller saysTool arguments
Tomorrow{"days": 1}
Two weeks from today{"weeks": 2}
Next Friday{"weekday": "friday", "occurrence": "next"}
Friday, including today{"weekday": "friday", "occurrence": "on_or_after"}
Friday of next week{"weekday": "friday", "occurrence": "next_week"}
The fifth{"day_of_month": 5}
The fifth of February, in the past{"day_of_month": 5, "month": 2, "direction": "past"}
Two weeks after a previously resolved date{"reference_date": "2026-12-01", "weeks": 2}

In agent timezone mode, also supply timezone in each example.

The agent should not turn weeks into days, count weekdays, or calculate an absolute date before calling. If a phrase does not map unambiguously to these arguments, ask the caller: 03/04, “end of June”, “next month” without a day, and an unspecified Gregorian/Hijri calendar do not establish an exact date.

Calendar rules

  • next and previous weekdays exclude the reference date itself. on_or_after and on_or_before include it.
  • this_week, next_week and last_week use week_starts_on (Monday by default). A weekday in this week can be in the past.
  • An incomplete day/month selects the next valid occurrence on or after the reference date. direction: "past" selects on or before it. An explicit year/date is respected even if it is in the past.
  • Calculations resolve the anchor, add calendar months, then weeks and days. January 31 plus one month becomes February's last day and reports month_end_clamped in adjustments. Explicit February 31 is invalid.
  • Dates stay dates; no midnight timestamp or UTC conversion is added. locale affects spoken formatting, not the calendar. Supported locales are en-US (default) and ar-SA.

Use the result

{
  "status": "resolved",
  "resolved_date": "2026-11-27",
  "weekday": "friday",
  "today": "2026-11-17",
  "reference_date": "2026-11-17",
  "timezone": "Asia/Riyadh",
  "timezone_source": "configuration",
  "days_from_today": 10,
  "is_past": false,
  "date_spoken": "Friday, 27 November 2026",
  "adjustments": []
}

Confirm date_spoken in the caller's language and reuse resolved_date exactly. The latest successful calculation writes {{slots.resolve_date_date}}, {{slots.resolve_date_timezone}} and {{slots.resolve_date_spoken}} for subsequent tool templates. Each new calculation clears these slots first, including when a correction fails.

If the caller supplies both a date and weekday, the tool checks them before applying offsets. A disagreement returns status: "weekday_mismatch", the actual weekday, expected_weekday, and a clarification question. Ask which they meant; do not treat the returned date as confirmed or continue booking. In assistant timezone mode, an omitted timezone returns needs_clarification. Other invalid model arguments return invalid; service failures return unavailable. Neither should cause the agent to guess a date.

For callbacks, combine the resolved date with the agreed time and timezone, then use Schedule a call. Configure scheduling to use the same timezone: a matching fixed zone or assistant-filled timezone when the date resolver can choose a different one. The scheduling result remains authoritative about the actual booked time, which contact-hours policy may adjust. Payment approval windows and holiday rules belong in the action that consumes the date.

Calculate through the public API

POST /v1/dates/resolve uses the same calendar engine. It requires tools:read, an explicit timezone, and no Idempotency-Key. Its body contains the date arguments plus optional week_starts_on and locale:

{
  "timezone": "Asia/Riyadh",
  "reference_date": "2026-11-17",
  "weekday": "friday",
  "occurrence": "next_week",
  "week_starts_on": "sunday",
  "locale": "en-US"
}

This returns November 27, 2026. days_from_today reflects the real date when executed. A valid calculation or weekday mismatch returns 200; invalid dates, zones, types or field combinations return 422. Duplicate JSON fields are rejected with 400. Null values are not accepted.

Migrate an existing Resolve Date tool

Create a new draft. Detach the existing catalog tool before enabling the built-in: a shared resolve_date name is rejected with tool_name_conflict. Update prompt references and any response-slot mappings, then run date-focused evaluations before promoting.

Preserve the old tool's timezone explicitly. Its proxy may use a different timezone from the team default. Also check whether its bare weekday includes today, how it defines next week, and whether it combines arithmetic with business-specific approval rules. Existing published versions are not migrated automatically.

On this page