Skip to main content

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​

ParameterTypeRequiredDescription
datestringYesISO 8601 date to check, e.g. "2026-12-25".
country_codestringYesISO 3166-1 alpha-2 country code, e.g. "US", "DE", or "FR".
global_onlybooleanNoWhen true, only nationwide holidays count as non-working days; regional holidays are ignored. Defaults to false.

Response​

FieldTypeDescription
is_workdaybooleantrue when the date is a Monday–Friday that is not a public holiday, otherwise false.
reasonstringPresent 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).

CodeWhenDelivered as
invalid_argumentsAn argument is missing or the wrong type.protocol error (invalid_params)
invalid_datetimedate is not a valid ISO 8601 date (e.g. missing year, wrong format).tool error (isError)
invalid_countrycountry_code is not supported by the holiday data provider.tool error (isError)
internal_errorAn 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_only flag mirrors the same parameter on public_holidays_list and public_holidays_in_range. Set it to true if 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.