Skip to main content
Glama

x420_util_date-math

Read-onlyIdempotent

Date math: Add or subtract a duration ("2d", "-3h", "1w 2d", "90m", "6mo", "1y") to a date, difference between two dates, exact age in years/months/days, weekday with ISO week and day-of-year, or Monday-to-Friday business days between two dates. UTC, deterministic. Source: computation. Not professional, legal, insurance, engineering, medical, financial or tax advice. Price: $0.001 USDC per call (x402 on Base). This hosted tool does NOT pay and does NOT return the deliverable: it validates the input and returns payment instructions (pay_to, network, price and the x402 URL to pay at). GET the url; read PAYMENT-REQUIRED from the 402; retry with PAYMENT-SIGNATURE (x402 v2). Or run the local x420-mcp server with your own wallet key to pay automatically. Deliverable once paid: JSON per op: result / ms,days,human / years,months,days / weekday,iso_week / business_days.

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": {
      "duration": "<duration>"
    },
    "name": "x420_util_date-math"
  }
}

Input Schema

NameRequiredDescriptionDefault
opNoadd (default), diff, age, weekday or business_days
dateNoISO 8601 date or 'now' (default now)
date2Nofor diff, age, business_days: the second date (default now)
durationYesfor add: e.g. 2d, -3h, 1w 2d, 90m, 6mo, 1y

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the single most important behavioral trait: the hosted tool does NOT return the deliverable, it validates input and returns payment instructions (pay_to, network, price, x402 URL). It also states UTC/deterministic semantics, the exact price per call, and the concrete JSON shape returned once paid.

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?

Purpose and operation list are front-loaded, and the payment mechanics are necessary context rather than filler. The compliance disclaimer ("Not professional, legal, insurance... advice") and the closing deliverable sentence add length that does not help an agent decide or invoke, costing some tightness.

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?

There is no output schema, and the description compensates by specifying the per-op JSON fields returned after payment. Combined with the payment flow, defaults ('now'), and operation coverage, an agent has everything needed to call it and interpret the response.

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 all four parameters are already documented in the schema, including which op each field applies to. The description restates the duration examples and op names but adds no format details, defaults, or edge-case behavior beyond that, so the baseline of 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?

The opening sentence names a specific resource (date math) and enumerates the exact operations: add/subtract a duration, difference between dates, exact age, weekday with ISO week/day-of-year, and business days. The accepted duration syntaxes ("2d", "-3h", "1w 2d", "90m", "6mo", "1y") make the scope unambiguous and clearly separate it from a date-lookup tool like date-finder.

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?

The description ties each operation to a use case and states the payment path explicitly (hosted tool returns instructions; GET the url, read PAYMENT-REQUIRED, retry with PAYMENT-SIGNATURE, or use the local x420-mcp server with your own key). It does not explicitly say when to prefer a sibling tool, but the operation list leaves little ambiguity about fit.

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