Skip to main content
Glama

Agent Data Hub

Date calculator: add/subtract durations, days between dates

util_date_calc
Read-onlyIdempotent

Exact date math so the agent does not miscount: add or subtract a duration ("3 months, 2 days", "-10d", "2w", "15 business days", ISO "P1Y2M10D", hours/minutes) to a date, and/or get the difference to another date as calendar years/months/days plus total days, weeks, hours, seconds and Mon–Fri business days. Every date comes back with weekday, ISO week, day of year, quarter, leap year, days in month and unix time. Month-end safe (Jan 31 + 1 month = Feb 28/29). Use for deadlines, ages, due dates, SLAs, countdowns. UTC. Price: $0.001 per call (USDC on Base via x402); the first 10 calls per day are free.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "util_date_calc"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoOptional second date to measure the difference to
addNoDuration to add, e.g. '3 months, 2 days', '2w', '15 business days', '36h', 'P1Y2M10D'
dateNoStart date: YYYY-MM-DD, ISO date-time, unix seconds/ms, 'today' (default) or 'now'
subtractNoDuration to subtract (same format as add)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/non-destructive, and the description adds material context: all computation is UTC, month-end clamping is handled (Jan 31 + 1 month = Feb 28/29), the full set of returned fields is listed, and cost is disclosed ($0.001/call with 10 free calls per day). These are behavioral facts an agent cannot get from structured fields.

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?

Front-loaded with the core purpose in the first clause, then duration formats, then return shape, then use cases, then cost. Dense but every clause carries distinct information; the format examples and month-end rule are not filler.

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?

There is no output schema, and the description compensates by enumerating what each date result contains (weekday, ISO week, day of year, quarter, leap year, days in month, unix time) plus total days/weeks/hours/seconds and Mon–Fri business days. Combined with 100% schema coverage and annotations, nothing needed to invoke it correctly is missing.

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 baseline is 3, but the description adds real meaning: negative durations ('-10d') are a valid input form and add/subtract can be combined with 'to' to both shift and measure in one call. It stops short of documenting unit edge cases or how 'to' interacts with 'subtract', which keeps it at 4.

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 specific verbs and resource: add or subtract a duration to a date, and get the difference to another date, with output described as calendar components plus totals. The purpose is unmistakable, but it never names or contrasts with siblings such as util_time or calendar_business_days, so an agent must infer which one to pick.

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?

'Use for deadlines, ages, due dates, SLAs, countdowns' gives concrete triggers and the description frames the tool as exact math to avoid miscounting. There is no explicit when-not guidance or named alternative, so it falls short of a 5.

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