Skip to main content
Glama

Agent Data Tools: Utilities

Difference between two dates

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. Example: from=2026-01-01, to=2026-10-18. Price $0.003/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only; not marked read-only because each call is charged.

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
Behavior4/5

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

Goes beyond the annotations by explaining why readOnlyHint is false ('each call is charged') and disclosing pricing, the free-call allowance, and free failed calls. It also fully describes the computed output. Minor gap: no mention of timestamp format tolerance or error behavior.

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-loads the returned computation, then usage, example, and pricing. Efficient and well-ordered, though the pricing/payment sentence is somewhat boilerplate-heavy for an agent selecting a tool.

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?

With no output schema, the description carries return-value disclosure well by listing every computed field. It is essentially complete for a two-param pure-computation tool, with only format-handling edge cases unspecified.

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 the schema already documents both parameters. The description adds a concrete example (from=2026-01-01, to=2026-10-18) but no extra semantics beyond the schema's 'Start/End date or ISO timestamp'. Baseline 3 applies.

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 ('Time between two dates or timestamps') and enumerates exactly what is returned (total days, weeks, hours, minutes, seconds, Y-M-D breakdown, weekdays). This cleanly distinguishes it from sibling date tools like date_add and date_info.

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?

Gives clear use cases ('Use for deadlines, ages and durations') plus a concrete example. However, it never names an alternative sibling (e.g., date_add for arithmetic) or states exclusions, so routing between date tools is left partly to inference.

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.