Skip to main content
Glama

date_diff

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. Costs $0.001 in USDC on Base per successful call, paid with x402.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesEnd date or ISO timestamp
fromYesStart date or ISO timestamp

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Adds behavior the annotations cannot convey: a $0.001 USDC-on-Base charge per successful call via x402, which explains the non-read-only character of an otherwise pure computation. It also describes the return shape (totals plus a Y-M-D breakdown plus weekday count), compensating for the absent output schema.

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?

Three tight sentences, front-loaded with the output enumeration before usage and pricing. Little waste, though the pricing sentence could arguably be folded more compactly.

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

Completeness4/5

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

For a two-param, no-output-schema tool the description covers outputs and payment mechanics well. It could still note date-format edge cases or the inclusive/exclusive counting convention, but nothing critical 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% with only two clearly described parameters (from, to), so the schema already carries the semantics. The description adds no format or edge-case detail (e.g., timezone handling, inclusive/exclusive endpoints) beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (computes the time between two dates/timestamps) and enumerates the exact outputs produced, which an agent can distinguish from siblings like date_add, date_info, unix, and time. The scope is unambiguous.

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?

"Use for deadlines, ages and durations" gives implied usage context, but there is no explicit when-not guidance and no named alternative (e.g., date_add for shifting dates). The agent must infer the boundary from the sibling list.

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