is_workday
Check whether a specific date is a workday in a given country. A workday is defined as a Monday through Friday that is not a public holiday. Returns a reason field when the date is not a workday.
Holiday data is sourced from the Nager.Date public API, which covers 115+ countries.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
date | string | Yes | ISO 8601 date to check, e.g. "2026-12-25". |
country_code | string | Yes | ISO 3166-1 alpha-2 country code, e.g. "US", "DE", or "FR". |
global_only | boolean | No | When true, only nationwide holidays count as non-working days; regional holidays are ignored. Defaults to false. |
Response
| Field | Type | Description |
|---|---|---|
is_workday | boolean | true when the date is a Monday–Friday that is not a public holiday, otherwise false. |
reason | string | Present only when is_workday is false. Either "weekend" or "public holiday: <name>". |
Examples
Regular workday
{
"date": "2026-04-13",
"country_code": "US"
}
Result:
{
"is_workday": true
}
Weekend
{
"date": "2026-04-11",
"country_code": "US"
}
Result:
{
"is_workday": false,
"reason": "weekend"
}
Public holiday on a weekday
{
"date": "2026-12-25",
"country_code": "US"
}
Result:
{
"is_workday": false,
"reason": "public holiday: Christmas Day"
}
Ignoring regional holidays with global_only
{
"date": "2026-11-11",
"country_code": "DE",
"global_only": true
}
Result:
{
"is_workday": true
}
Errors
Each failure carries a precise code in the response. Argument-schema and server errors are JSON-RPC protocol errors; a rejected value is returned as a tool result with isError: true (so the agent can read the code and self-correct).
| Code | When | Delivered as |
|---|---|---|
invalid_arguments | An argument is missing or the wrong type. | protocol error (invalid_params) |
invalid_datetime | date is not a valid ISO 8601 date (e.g. missing year, wrong format). | tool error (isError) |
invalid_country | country_code is not supported by the holiday data provider. | tool error (isError) |
internal_error | An unexpected server error. | protocol error (internal_error) |
Notes
- "Workday" means Monday–Friday and not a public holiday. Custom or company-specific non-working days are not considered.
- The
global_onlyflag mirrors the same parameter onpublic_holidays_listandpublic_holidays_in_range. Set it totrueif you want to treat only nationwide holidays as non-working days and ignore state- or region-level holidays. - Supported country codes include
US,GB,DE,FR,JP,AU,CA,BR, and 100+ others. See Nager.Date available countries for the full list. - Holiday data is fetched from the Nager.Date API at call time and cached in memory for the lifetime of the server process. Weekend checks are purely local and require no network call.