Skip to main content
Glama

Time between two dates

date_diff
Read-onlyIdempotent

Calculates the exact time between two dates/times: a calendar breakdown (years, months, days, hours, minutes, seconds) plus totals in days, hours, minutes and seconds, and the number of calendar days. Negative if end is before start.

Input Schema

NameRequiredDescriptionDefault
endYesDate/time in ISO 8601 (e.g. "2026-03-08T14:30", "2026-03-08T14:30:00Z", "2026-03-08"), "YYYY-MM-DD HH:mm", a Unix timestamp in seconds or milliseconds, or "now".
startYesDate/time in ISO 8601 (e.g. "2026-03-08T14:30", "2026-03-08T14:30:00Z", "2026-03-08"), "YYYY-MM-DD HH:mm", a Unix timestamp in seconds or milliseconds, or "now".
timezoneNoTime zone for inputs without an offset. IANA time zone name, e.g. "America/New_York", "Europe/London", "Asia/Tokyo", or "UTC". Fixed offsets like "UTC+5:30" also work. Defaults to UTC.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds useful behavioral context beyond those annotations: the exact output structure (calendar breakdown plus totals) and the sign convention for reversed dates. With no output schema, this disclosure is valuable, though no auth/rate-limit details are needed for a pure calculator.

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?

A single, front-loaded sentence that states the operation first and then details the output components. Every clause earns its place by specifying return formats without padding.

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 stateless date-difference calculator with no output schema, the description fully covers the return values an agent needs: calendar breakdown, totals, calendar days, and negative sign. Input formats and timezone handling are covered by the schema, and safety is covered by annotations. Nothing material is missing.

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%, so start, end, and timezone are fully documented in the schema. The description adds no parameter-specific meaning beyond what the schema provides; 'two dates/times' and the sign convention are not parameter semantics. Baseline 3 applies.

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 and resource: 'Calculates the exact time between two dates/times'. The output breakdown (calendar, totals, calendar days) makes the tool's scope concrete, though it does not explicitly contrast with siblings like business_days or date_add, so sibling differentiation is implicit.

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?

Provides no when-to-use guidance or alternatives. It notes the negative result condition but does not say when to choose date_diff over business_days or date_add, leaving usage inference to the agent.

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