Skip to main content
Glama

Date Math

Add to a date

date_add
Read-onlyIdempotent

Add or subtract years/months/weeks/days/business days/hours/minutes/seconds. Month-end clamping; business days skip weekends, given holidays, and the public holidays of an optional country. Costs $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
holidaysNoDates excluded from business-day counts (weekends are always excluded)
business_daysNoApplied after calendar units; skips weekends 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 observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnly/idempotent/closed-world, yet the description adds genuinely new behavior: month-end clamping semantics and the fact that business days skip weekends, supplied holidays, and country public holidays. It also discloses cost ($0.001 per call via x402), which no structured field conveys. It stops short of covering ordering of applied units or timezone/DST effects on hour arithmetic.

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

Conciseness5/5

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

Two terse, front-loaded sentences with the unit list first, then the behavioral caveats and cost. Every clause carries information; nothing is redundant padding.

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?

For an 11-parameter tool with an output schema present, the definition covers the important edge cases an agent needs: clamping, holiday exclusion, and cost. Minor omissions are unit application order and timezone handling for sub-day units, which affect correctness in mixed-unit calls.

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

Parameters4/5

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

Schema description coverage is only 36%, so the description must compensate, and it largely does by enumerating all eight unit parameters plus the holiday and country modifiers in prose. The remaining gap is that interaction rules (e.g., ordering when multiple units are supplied) live mainly in the schema-level description rather than here.

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?

States a specific verb (add or subtract) and resource (date) and enumerates every supported unit, from years down to seconds and business days. This clearly separates it from siblings like date_diff, which measures rather than shifts dates.

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

Usage Guidelines3/5

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

Usage context is implied through the unit list and the note that business days skip weekends and holidays, which hints at when to prefer business_days over days. However, it never says when to use this instead of siblings such as business_hours_deadline or recurring_dates, and gives no prerequisites for the datetime requirement beyond what the schema states.

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.