Skip to main content
Glama

Agent Data Tools: Utilities

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 10 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

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": {
      "from": "<from>",
      "to": "<to>"
    },
    "name": "date_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
toYesEnd date or ISO timestamp
fromYesStart date or ISO timestamp

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint, destructiveHint=false), the description discloses the billing model: $0.01/call via x402 USDC or card key, first 10 free, failed calls free, and that repeats are not free. That last point usefully explains why idempotentHint is false and warns an agent against redundant retries. It restates 'changes nothing,' which the annotations already cover, and says nothing about authorization flow beyond the key mention.

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?

The result payload is front-loaded in the first sentence, followed by use cases, an example, billing, and a safety note — each clause carries distinct information. No filler and no redundant restatement of the title, despite the definition being longer than average.

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 correctly takes on the burden of enumerating return contents, and it covers cost and read-only behavior. The gap is boundary semantics — whether the end date is included in the totals and how timestamps without timezones are treated — which is material for a difference calculator.

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?

Schema coverage is 100%, so 'from'/'to' are already documented as start/end date or ISO timestamp, making 3 the baseline. The description adds a concrete example (from=2026-01-01, to=2026-10-18) that demonstrates the accepted date syntax. It does not clarify inclusive/exclusive endpoint handling, which is the one semantic detail an agent might still need.

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 opening states a specific verb and resource ('Time between two dates or 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 computes. It stops short of naming how it differs from the overlapping sibling date_business_days.

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 use-case context plus a worked example, which implies when to reach for it. It offers no exclusions and never routes the agent to an alternative such as date_business_days or date_add, so the guidance stays implied rather than explicit.

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