Skip to main content
Glama

Date difference: count the days, weeks and months between two dates

date_diff
Read-only

Time between two dates or timestamps: total days, weeks, hours, minutes and seconds, a years-months-days breakdown, and the number of weekdays (Monday-Friday) in between. Use for deadlines, ages and durations. Example: from=2026-01-01, to=2026-10-18. Price $0.01/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Input Schema

NameRequiredDescriptionDefault
toYesEnd date or ISO timestamp
fromYesStart date or ISO timestamp

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. Added

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses pricing ($0.01/call, first 25 free, failed calls free) and explicitly explains why repeats are not free, which makes the otherwise cryptic idempotentHint=false concrete. It also restates the compute-only, non-mutating nature, so the agent knows no state is touched.

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 return values, then usage, then an example, then billing. Dense but every clause carries information; the pricing sentence is long but load-bearing for a paid, non-idempotent call.

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?

No output schema exists, yet the description enumerates every return component, and both required params are covered. For a two-parameter read-only computation tool, an agent has everything needed to call it and interpret the result.

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 100%, so from/to are already documented as start/end date or ISO timestamp. The description adds only a sample value pair (2026-01-01 / 2026-10-18) that confirms the accepted format — helpful but marginal over the schema.

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 (time between two dates/timestamps) and enumerates the exact outputs: total days/weeks/hours/minutes/seconds, a years-months-days breakdown, and weekday count. An agent knows precisely what it gets, though it never names the neighbouring tools (date_add, date_business_days, calc_age) it overlaps with.

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 and durations" plus a concrete from/to example gives clear usage context. It stops short of exclusions or naming alternatives — "ages" overlaps with the sibling calc_age without disambiguation.

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.