Skip to main content
Glama

Date Calculator API - days between dates, add or subtract time

date_calculator
Read-onlyIdempotent

Days, weeks, months and years between two dates, or add/subtract days, weeks, months or years to a date. Runs on our server, files are deleted right after the call, nothing stored. Free: 5 calls/day per IP. Paid: Radar API key (from €9/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.001/call via x402 at https://radarbg.com/x402/date-calculator.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "date": "2026-01-01",
      "mode": "between",
      "date2": "2026-12-31"
    },
    "name": "date_calculator"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateYesDate YYYY-MM-DD
modeNobetween, add or subbetween
unitNodays, weeks, months or yearsdays
date2NoSecond date (mode=between)
numberNoHow many (mode=add/sub)
includeBothNoCount first and last day (mode=between)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / number / minimum
      Added value: +0
  2. Added

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint, so safety is covered. The description adds genuinely non-derived operational context: server-side execution, no storage, a 5 calls/day per IP free tier, and both auth paths (X-API-Key or x402 micropayment). The 'files are deleted right after the call' line is boilerplate that doesn't apply to a date calculation.

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 capability statement is front-loaded in one tight sentence, which is the right structure. The trailing sentence is overloaded with pricing URLs, an API-key header, and an x402 endpoint that crowd out more useful behavioral detail, and the file-deletion claim is irrelevant noise.

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?

For a six-parameter calculator with full schema coverage, the definition covers what the tool does, its modes, its storage and rate-limit behavior, and how to authenticate. Return values are self-evident for a date calculation (a duration or resulting date), so the absence of an output schema is not a meaningful gap.

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 description coverage is 100%, including enum values and defaults for mode, unit, and includeBoth, so the schema carries the parameter burden. The description restates the unit and add/sub options but adds no new semantics such as whether months clamp at month-end (e.g., Jan 31 + 1 month) or the accepted date format assumptions beyond the schema's 'YYYY-MM-DD'.

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?

The opening sentence names both capabilities precisely: computing days/weeks/months/years between two dates, and adding/subtracting those units to a date. That is a specific verb plus resource an agent can act on. It does not distinguish itself from overlapping siblings such as age_calculator, countdown_days_until, or business_days, so it stops short of a 5.

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 is implied through the mode vocabulary (between vs add/sub), which tells an agent the two broad scenarios the tool covers. There is no explicit when-to-use or when-not-to-use guidance, and no mention that working-day math belongs to business_days or timezone-shifted math to time_zone_converter.

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