Skip to main content
Glama

Count days between dates

count_days_between
Read-onlyIdempotent

Use this when the user asks how many days are between two dates (days between dates, count days, date calculator), how many business days or working days are between two dates, or days between dates excluding weekends and public holidays for a country or US state. Returns calendar days, weeks and days, years/months/days, business days, and the holidays skipped by name. The start date is counted; set include_end_date=true to also count the end date (Excel NETWORKDAYS style). Does not handle times of day or time zones. Holidays that fall on a weekend are not double-counted, and their observed weekday off (for example US Independence Day 2026 on Saturday is observed Friday July 3) is skipped as a holiday. Results are informational: legal deadlines may have special rules such as court holidays. Do not use for writing SQL or spreadsheet formulas.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "start": "<start>",
      "end": "<end>"
    },
    "name": "count_days_between"
  }
}

Input Schema

NameRequiredDescriptionDefault
endYesSecond date, e.g. 2027-01-15. Also accepts "January 15, 2027" or "today".
startYesFirst date, preferably YYYY-MM-DD, e.g. 2026-03-03. Also accepts "March 3, 2026", "3 March 2026" or "today".
countryNoCountry for public holidays as an ISO 3166 two-letter code, e.g. US, GB, DE, PL, AU, CA, IN. Omit to skip holidays (weekends only).
subdivisionNoOptional state/province/region code within the country for local holidays, e.g. TX or CA (US states), BY (Bavaria, DE), ENG or SCT (UK), NSW (AU), ON (CA).
weekend_daysNoNon-working weekdays, e.g. ["friday","saturday"]. Default saturday+sunday (friday+saturday for countries such as SA, IL, EG, QA, KW).
extra_holidaysNoExtra non-working dates to skip, e.g. company shutdown days ["2026-12-24","2026-12-31"].
include_end_dateNoCount the end date too (adds one day), e.g. true for 'from Monday through Friday'. Default false.
include_bank_holidaysNoAlso skip bank-only closing days where the data has them (e.g. Dec 24 and Dec 31 in Germany). Default false.

Output Schema

NameRequiredDescriptionDefault
endYes
kindYes
notesYes
startYes
weeksYes
inputsYes
monthsYes
regionYes
summaryYes
calendarYes
reversedYes
weekend_daysYes
business_daysYes
calendar_daysYes
holiday_sourceYes
holidays_skippedYes
include_end_dateYes
weekend_days_countYes
holidays_on_weekendsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/idempotent/non-destructive annotations, it discloses counting conventions (start counted, include_end_date adds one, Excel NETWORKDAYS style), holiday handling rules (weekend holidays not double-counted, observed weekday off skipped with a concrete example), and an informational-use caveat about legal deadlines. This is substantive behavioral context the annotations cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the triggering use case and alternatives, then supporting rules. It is somewhat long and the SQL/spreadsheet warning is slightly tangential, but nearly every sentence carries usable information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 8 parameters, an output schema present, and annotations covering safety, the description supplies everything an agent needs: counting semantics, holiday rules, and scope boundaries. Nothing material for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is already 100%, but the description still adds meaning: it clarifies the start-date counting convention, the semantic of include_end_date (Excel NETWORKDAYS style), and the default-vs-omitted country behavior. It goes beyond restating the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource ('how many days are between two dates') and enumerates the query phrasings it handles (count days, date calculator, business days). It clearly delineates its scope from date-offset or holiday-listing work, though it never names the actual siblings calculate_date_offset or list_holidays.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use it (days between dates, business/working days, excluding weekends and holidays) and includes a when-not-to-use clause ('Do not use for writing SQL or spreadsheet formulas'). It also declares an exclusion ('Does not handle times of day or time zones'), leaving little to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources