Skip to main content
Glama

Date Calc

date_calc
Read-only

Date and time calculations in pure code. op=diff: calendar years, months and days between two dates, and the total days. op=add or subtract: move a date by years, months, weeks, days, hours or minutes (month ends are clamped). op=info: weekday, ISO week, day of year, quarter, and age from birthDate. op=tz: a local date-time in one IANA time zone shown in another. Impossible dates are a 400 with the reason. Price: $0.002 in USDC per successful call, paid with x402 (Base, Solana or Arc); failed calls are not charged.

Input Schema

NameRequiredDescriptionDefault
opYesdiff, add, subtract, info or tz
toNodiff: end date YYYY-MM-DD
asOfNoinfo: the date the age is counted to, default today (UTC)
dateNoadd, subtract, info: date YYYY-MM-DD
fromNodiff: start date YYYY-MM-DD; tz: local date-time YYYY-MM-DDTHH:MM
unitNoadd, subtract: years, months, weeks, days (default), hours or minutes
amountNoadd, subtract: whole number
to_zoneNotz: IANA zone to show, e.g. America/New_York
datetimeNotz: local date-time like 2026-10-15T09:30
birthDateNoinfo: date of birth YYYY-MM-DD, for the age
from_zoneNotz: IANA zone of the given time, e.g. Europe/Berlin

Output Schema

NameRequiredDescriptionDefault
opNo
toNo
daysNo
fromNo
yearsNo
monthsNo
sourceNo
checkedAtNo
directionNo
totalDaysNo
totalHoursNo
totalWeeksNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld annotations: it discloses deterministic 'pure code' execution, month-end clamping on add/subtract, the failure mode ('impossible dates are a 400 with the reason'), and the billing model ($0.002 USDC per successful call, failed calls not charged). Pricing and failure semantics are exactly the non-obvious traits an agent needs before calling a paid endpoint.

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 core purpose, then a compact op-by-op enumeration, then error and pricing notes — every sentence carries information an agent needs. It is a single dense paragraph, so the op list and the billing note are harder to scan than they would be as separate lines.

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?

Given 11 parameters and an output schema (so return values need no explanation), the description covers all five operations, failure behavior and cost, which is nearly everything needed to call it correctly. The remaining gaps are DST handling for tz and disambiguation from the timezone/business_days siblings.

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 coverage is 100%, so the baseline is 3, and the description adds genuinely new semantics: the allowed op set, default unit behavior, defaults implied by 'asOf', and the clamping rule that applies to amount/unit combinations. It does not clarify DST/ambiguous local times for the tz op, which is the one parameter area the schema is silent on.

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?

States a specific verb+resource ('date and time calculations in pure code') and then spells out exactly what each of the five ops does, so an agent can pick the right operation. It does not, however, distinguish itself from overlapping siblings such as timezone, business_days, holidays or cron, which is a real ambiguity for op=tz.

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?

Each op is given a concrete use case (diff = elapsed calendar time, add/subtract = shift a date, info = weekday/ISO week/age, tz = convert between IANA zones), which effectively tells the agent when to choose which op. There is no when-not guidance or pointer to alternatives, notably for op=tz versus the timezone sibling tool.

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