Skip to main content
Glama
Date Math – Business Days, Holidays & Time Zones

Date Math – Business Days, Holidays & Time Zones

Add to a date

date_add
Read-onlyIdempotent

Add or subtract years, months, weeks, days, business days, hours, minutes, or seconds from a date to calculate due dates, deadlines, delivery estimates, and expiry dates.

Instructions

Add or subtract years/months/weeks/days/business days/hours/minutes/seconds from a date. Month-end clamping; business days skip weekends, given holidays, and the public holidays of an optional country. Use for due dates, deadlines, delivery estimates, expiry and "N working days from today". First 25 calls per day are free, then $0.001 per call (x402).

Input Schema

NameRequiredDescriptionDefault
dateYesYYYY-MM-DD, or ISO 8601 datetime with Z or offset
daysNo
hoursNo
weeksNo
yearsNo
monthsNo
countryNoISO 3166-1 alpha-2 country code (207 countries); its public holidays (2000–2050) are excluded from business days
minutesNo
secondsNo
holidaysNoExtra dates excluded from business-day counts (rest days from workdays are always excluded)
workdaysNoWorking days of the week, 0 = Sunday. Default [1,2,3,4,5] (Mon–Fri); e.g. [0,1,2,3,4] for Sun–Thu or [1,2,3,4,5,6] for Mon–Sat
business_daysNoApplied after calendar units; skips rest days (see workdays) and holidays

Output Schema

NameRequiredDescriptionDefault
inputYes
resultYesYYYY-MM-DD, or ISO datetime (UTC) for datetime input
weekdayYes
is_business_dayYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and closed-world, so the description doesn't need to restate safety. It adds genuinely non-obvious behavior: month-end clamping, business-day weekend/holiday skipping, country holiday tables (2000–2050), and ordering of business_days after calendar units. A clear pricing/rate-limit disclosure (25 free calls/day, then $0.001 via x402) is exactly the kind of cost signal an agent needs before calling.

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?

Three sentences, front-loaded with capability, then semantics, then pricing — no filler. The pricing sentence could arguably move to the end or be omitted for pure-function selection, but it is short and earns its place by flagging cost.

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

Completeness4/5

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

With an output schema present, return values needn't be described, and the description covers the tricky semantics (clamping, business-day ordering, holiday sources) that an agent would otherwise get wrong. Twelve parameters at 42% coverage leave some unit-level detail to the schema, which is acceptable given the schema's own notes.

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

Parameters3/5

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

Schema coverage is 42%, so several parameters (days, hours, weeks, years, months, minutes, seconds, business_days) carry only name and type. The schema's own description covers negative values, month clamping, and the datetime requirement for time units, and the tool description restates the clamping and holiday behavior. It does not add unit-syntax or interaction guidance beyond that, matching the baseline 3.

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 leads with a specific verb+resource pair and enumerates every supported unit (years/months/weeks/days/business days/hours/minutes/seconds), including subtraction via negative values. It is clearly distinguishable from siblings like date_diff (elapsed time) and business_day (which appears to count rather than shift).

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?

It names concrete use cases — due dates, deadlines, delivery estimates, expiry, and "N working days from today" — which routes the agent to this tool for forward/backward date shifting. It stops short of explicitly naming alternatives such as business_day or business_hours_deadline and when to prefer them.

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