Title99/100
Count days between dates
The title clearly communicates the tool’s action and subject. Keep it concise.
Description90/100
Use for any 'how many days between two dates' question: plain date difference, age or duration, or business days. By default, counts all calendar days, including the earlier date and excluding the later date. For business days, set excludeWeekdays, for example [0,6] for Saturday and Sunday. To also skip public holidays, set excludeHolidays and country, and region for a regional calendar. To check if one date is a working day, use the same date as start and end with includeEnd true: days is 1 or 0. Plain reversed dates give a negative count; filtered counts are never negative. If holiday data is unavailable, the call fails. Returns the count, weekday and ISO week of both dates, elapsed years, months and days for plain counts, warnings to read, the rules used and a share link.
The description explains the capability, when to use it, and what to expect.
Inputs88/100
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
start
Calendar date, YYYY-MM-DD. Order does not matter for the count, but a plain reversed count is negative.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
end
Calendar date, YYYY-MM-DD. Order does not matter for the count, but a plain reversed count is negative.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
includeEnd
Set true to count both dates (inclusive). Default false.
Clear enough to supply this argument.
excludeWeekdays
Weekdays to exclude: 0 Sunday through 6 Saturday. Default none. Use [0,6] for a Saturday and Sunday weekend; some countries have a different weekend, so choose the days for the country.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
excludeHolidays
Exclude public holidays, including observed dates, as full days. The data does not mark half-day holidays. Requires country; unavailable holiday data is an error.
Clear enough to supply this argument.
country
Canonical uppercase ISO country code; discover supported codes with list_locations.
Clear enough to supply this argument.
region
Exact subdivision code from list_locations; omit for the national calendar.
Clear enough to supply this argument.
language
Website language, default en. All 32 site languages; nb/no and zh-Hans/zh-cn, zh-Hant/zh-tw aliases are accepted. Holiday names may fall back to their native language. Weekday names in results are always English.
Remove validation rules already expressed in this field’s schema; describe its meaning and usage instead.
Annotations100/100
All four behavior hints are declared.
{
"readOnlyHint": true,
"openWorldHint": false,
"idempotentHint": true,
"destructiveHint": false
}Output schema61/100
Describe the returned fields so an agent can interpret the result.
View output schema
{
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"ok",
"days",
"excludedDays",
"calendarDays",
"filtered",
"excludedHolidayDates",
"startDate",
"endDate",
"warnings",
"rules",
"holidayData",
"shareUrl"
],
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"days": {
"type": "number"
},
"rules": {
"type": "object",
"required": [
"calendar",
"timezone",
"mode",
"start",
"excludeWeekdays",
"excludeHolidays",
"country",
"region",
"language",
"boundaryRule"
],
"properties": {
"end": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"days": {
"type": "number"
},
"mode": {
"enum": [
"count",
"add",
"subtract"
],
"type": "string"
},
"roll": {
"enum": [
"none",
"next",
"previous"
],
"type": "string"
},
"start": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"weeks": {
"type": "number"
},
"years": {
"type": "number"
},
"months": {
"type": "number"
},
"region": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"description": "Exact subdivision code from list_locations; omit for the national calendar."
},
{
"type": "null"
}
]
},
"country": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Z]{2}$",
"description": "Canonical uppercase ISO country code; discover supported codes with list_locations."
},
{
"type": "null"
}
]
},
"calendar": {
"type": "string",
"const": "Gregorian"
},
"language": {
"type": "string"
},
"timezone": {
"type": "string",
"const": "UTC calendar dates (no time of day)"
},
"includeEnd": {
"type": "boolean"
},
"boundaryRule": {
"type": "string"
},
"adjustmentRule": {
"type": "string"
},
"excludeHolidays": {
"type": "boolean"
},
"excludeWeekdays": {
"type": "array",
"items": {
"type": "number"
}
}
},
"additionalProperties": false
},
"weeks": {
"type": "number"
},
"years": {
"type": "number"
},
"months": {
"type": "number"
},
"elapsed": {
"type": "object",
"required": [
"years",
"months",
"days"
],
"properties": {
"days": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
},
"years": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
},
"months": {
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
}
},
"additionalProperties": false
},
"endDate": {
"type": "object",
"required": [
"date",
"weekday",
"isoWeek"
],
"properties": {
"date": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"isoWeek": {
"type": "string",
"pattern": "^\\d{4}-W\\d{2}$"
},
"weekday": {
"type": "string"
}
},
"additionalProperties": false
},
"filtered": {
"type": "boolean"
},
"shareUrl": {
"type": "string",
"format": "uri"
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
},
"startDate": {
"type": "object",
"required": [
"date",
"weekday",
"isoWeek"
],
"properties": {
"date": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"isoWeek": {
"type": "string",
"pattern": "^\\d{4}-W\\d{2}$"
},
"weekday": {
"type": "string"
}
},
"additionalProperties": false
},
"holidayData": {
"anyOf": [
{
"type": "object",
"required": [
"source",
"dataVersion",
"generatedAt",
"country",
"region",
"coverage",
"fetchedRange",
"languageRequested",
"languageUsed",
"languageFallback",
"category",
"observed"
],
"properties": {
"region": {
"anyOf": [
{
"type": "string",
"maxLength": 64,
"description": "Exact subdivision code from list_locations; omit for the national calendar."
},
{
"type": "null"
}
]
},
"source": {
"type": "string",
"const": "https://api.onlinealarmkur.com"
},
"country": {
"type": "string",
"pattern": "^[A-Z]{2}$",
"description": "Canonical uppercase ISO country code; discover supported codes with list_locations."
},
"category": {
"type": "string",
"const": "public"
},
"coverage": {
"type": "object",
"required": [
"startYear",
"endYear"
],
"properties": {
"endYear": {
"type": "integer",
"maximum": 9999,
"minimum": 1
},
"startYear": {
"type": "integer",
"maximum": 9999,
"minimum": 1
}
},
"additionalProperties": false
},
"observed": {
"type": "boolean",
"const": true
},
"dataVersion": {
"type": "string"
},
"generatedAt": {
"type": "string"
},
"fetchedRange": {
"type": "object",
"required": [
"startYear",
"endYear"
],
"properties": {
"endYear": {
"type": "integer",
"maximum": 9999,
"minimum": 1
},
"startYear": {
"type": "integer",
"maximum": 9999,
"minimum": 1
}
},
"additionalProperties": false
},
"languageUsed": {
"type": "string"
},
"languageFallback": {
"type": "boolean"
},
"languageRequested": {
"type": "string"
}
},
"additionalProperties": false
},
{
"type": "null"
}
]
},
"calendarDays": {
"type": "number"
},
"excludedDays": {
"type": "number"
},
"excludedHolidayDates": {
"type": "array",
"items": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
}
}
},
"additionalProperties": false
}