Compute a deadline with an explanation trail
compute_deadlineCompute the end of a period ('within 30 calendar days', '10 working days', '3 months') from a start date under explicit counting rules, roll it by the chosen convention when it lands on a non-working day, and return raw vs final deadline, skipped days and a step-by-step explanation plus a disclaimer. Pass the rules the contract/law states; defaults are the common ones. Example: start_date '2026-11-26', period 7, unit 'calendar_days', country 'GB'. Calendar selection: country (ISO 3166-1 alpha-2, e.g. 'SA', 'DE', 'US') or market (MIC, e.g. 'XNYS', 'XLON'); optional subdivision (state/province/emirate code from list_calendars), categories (e.g. ['public','bank']), weekend override (['FRI','SAT']), extra_holidays (company/contract dates). Weekend defaults to the country's legal weekend. Response: result plus data_confidence (high = fixed-date calendar; medium = a lunar/moon-sighted or projected holiday is involved, or the caller overrode the weekend), estimated_items[] naming each projected date, sources[] (public references behind the calendar), data_version and warnings[].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | Yes | calendar_days | working_days | months. | |
| market | No | Financial market MIC (XNYS, XLON, XETR, XHKG, XJPX, XSAU…) — trading/settlement calendar instead of a country. | |
| period | Yes | Length of the period; negative counts backwards. | |
| country | No | ISO 3166-1 alpha-2 country code. Required unless market is given. | |
| weekend | No | Override the weekend, e.g. ['FRI','SAT'] or ['SUN']. Default: the country's legal weekend. | |
| language | No | Language for holiday names where available (e.g. 'ar', 'de', 'en_US'). Default: the country's own. | |
| categories | No | Holiday categories to count as non-working; default ['public']. Others per country: bank, government, school, optional, half_day, catholic… | |
| convention | No | What to do when the raw deadline lands on a non-working day. Default following (roll to the next working day); 'none' leaves it. | following |
| start_date | Yes | ISO date the period runs from (service, invoice, filing date…). | |
| subdivision | No | Sub-national code (US 'CA', DE 'BY', AE 'DU', CA 'ON', AU 'NSW', IN 'KA'…). See list_calendars. | |
| extra_holidays | No | Additional non-working ISO dates (company closures, contract-specific days). | |
| month_end_clamp | No | For months: clamp 31 Jan + 1 month to 28/29 Feb (true) or overflow into March (false). | |
| exclude_start_day | No | Day 1 is the day after start_date (true, the common convention) or start_date itself (false). | |
| include_estimated_holidays | No | Count projected lunar/moon-sighted holidays as non-working (true) or ignore them until announced (false). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||