Skip to main content
Glama

Count business days between two dates

business_days_between
Read-onlyIdempotent

FREE, unmetered. Business days between two dates. business_days counts (from, to] and is negative when to is before from, so add_business_days(from, business_days) lands on to whenever to is a business day; business_days_inclusive counts both ends. Also returns weekend days and the public holidays in range. Uses the country's national public-holiday calendar and its statutory weekend rule (Gulf Friday+Saturday, Israel Saturday-only, India 2nd/4th Saturdays, Nepal's 2026 change, China's multi-day breaks and make-up working days). A date in a year whose holidays we do not hold is refused with error year_not_held and the years_held list; it is never computed from weekends alone. A statutory holiday whose date is not yet fixed is refused as holiday_date_pending. Regional (sub-national) holidays are not applied.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesRange end, YYYY-MM-DD
fromYesRange start, YYYY-MM-DD
countryYesISO 3166-1 alpha-2 country code, e.g. 'za', 'ae', 'in'. Every country we hold a holiday calendar for is accepted on every brand, not only this brand's region.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNo
freeNo
fromNo
yearNoOn year_not_held: the year we do not hold
basisNo
errorNoPresent on a free refusal or error; no charge
priceNo
caveatsNo
countryNo
reachedNoOn a refusal: the first date the calculation could not classify
weekendNoWeekend days applied, the basis of that rule, and any dated or sub-national note
calendarNoHoliday calendar used: years_held, source, last_confirmed, stale
no_chargeNo
price_usdNo
conventionNo
disclaimerNo
how_to_payNo
years_heldNoOn year_not_held: the years whose holidays we do hold
bind_seriesNo
explanationNo
x_next_bindNo
country_nameNo
weekend_daysNo
business_daysNoBusiness days in (from, to]; negative when to is before from
http_endpointNo
what_you_can_doNo
payment_requiredNotrue when the call needs payment; how_to_pay explains x402 or card
business_days_inclusiveNoBusiness days counting both ends
calendar_days_inclusiveNo
public_holidays_on_weekdaysNo
public_holidays_on_weekendsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description adds substantial behavioral detail: it is free and unmetered, defines the counting semantics including negative ranges, explains that weekend days and public holidays are returned, lists specific statutory weekend rules, and documents error behaviors such as year_not_held and holiday_date_pending. These are all meaningful operational traits not covered by the readOnly/idempotent annotations.

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?

The description is front-loaded with the core purpose and key constraint, and most sentences are dense with useful detail. It is somewhat long and includes several illustrative country examples that, while relevant, could be trimmed for brevity, but the structure remains clear and purposeful.

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?

Given the tool's complexity and the existence of an output schema, the description is complete enough for correct invocation. It covers calculation semantics, return contents, calendar limitations, and explicit error conditions, leaving no significant ambiguity for an agent to resolve.

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?

Although schema coverage is already 100%, the description adds important semantic meaning: country selects a national public-holiday calendar and statutory weekend rule, from/to follow half-open interval semantics with potential negative counts, and regional holidays are excluded. This goes well beyond the schema's terse date and country-code descriptions.

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

Purpose5/5

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

The description states a precise verb and resource: counting business days between two dates. It distinguishes itself from the sibling add_business_days by explaining the inverse relationship and the interval convention '(from, to]', and it clarifies the inclusive-counting variant, so an agent can identify the tool's exact purpose without opening the schema.

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

Usage Guidelines4/5

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

The description clearly explains when the tool is appropriate: counting business days between two dates while accounting for national holidays and statutory weekends. It also notes limitations such as regional holidays not being applied and errors for unsupported years, but it does not explicitly contrast with other date-related siblings like is_business_day or count_working_days.

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