Skip to main content
Glama

date_diff

Read-only

Calculate the difference between two dates or times, returning calendar years/months/days, exact duration, totals, and weekday counts across time zones.

Instructions

Difference between dates: calendar y/m/d, exact duration, totals, Mon-Fri weekdays. Times: now, today, YYYY-MM-DD[ HH:MM], DD.MM.YYYY[ HH:MM], HH:MM, unix. Zones: IANA, city, CET/PST; default local.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "start": "<start>"
    },
    "name": "date_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNodefault now
startYes
timezoneNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.2

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds genuinely new behavioral context: default local timezone, accepted timestamp formats, and that mixing formats/zones is supported. It stops short of stating rounding/precision rules or how totals and weekdays are counted.

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?

Two dense, front-loaded clauses with no filler; the purpose is stated first and the accepted formats follow. The telegraphic style ("calendar y/m/d, exact duration, totals") is efficient but slightly terse, costing a little clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description usefully lists what is returned (calendar y/m/d, exact duration, totals, weekdays), which is the right thing to cover. However it omits failure behavior for malformed dates, how "totals" are aggregated, and whether weekdays exclude holidays — meaningful gaps for a date-math tool.

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?

Only 33% of parameters are documented in the schema (end: "default now"), so the description must compensate, and it does: it enumerates valid time inputs (now, today, YYYY-MM-DD[ HH:MM], DD.MM.YYYY[ HH:MM], HH:MM, unix) and zone inputs (IANA, city, CET/PST, default local), which implicitly covers start, end and timezone.

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 description opens with a specific verb+resource: "Difference between dates", then enumerates the computed outputs (calendar y/m/d, exact duration, totals, Mon-Fri weekdays). It is distinguishable from siblings like date_add because it computes a difference rather than shifting a date, though it never names an alternative explicitly.

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

Usage Guidelines2/5

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

There is no explicit when-to-use or when-not-to-use guidance and no pointer to alternatives such as date_add or holidays. Usage is only implied by the phrase "Difference between dates", leaving the agent to infer the context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.