Skip to main content
Glama

time_duration

Read-only

Duration parser and converter — Parse any duration and convert it: ISO 8601 (P1DT2H30M, PT90M, P2W), human text (1h 30m, 2 days 3 hours, an hour and a half, 1.5h, 90 minutes, 2 fortnights), clock (1:30:00, D:HH:MM:SS) or plain seconds (unit= ms|s|m|h|d). Returns components, totals in ms/seconds/minutes/hours/days/weeks, normalized ISO 8601, human-readable text, clock HH:MM:SS and compact 1h30m forms. Optional start= ISO date/time (+ direction=add|subtract) returns the exact end date with calendar-aware months (Jan 31 + P1M = Feb 28) and its weekday. Offline. Price: $0.001 USDC (Base, via x402).

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": {
      "d": "<d>"
    },
    "name": "time_duration"
  }
}

Input Schema

NameRequiredDescriptionDefault
dYes2 days 3 hours 15 minutes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3/5.0
Behavior1/5

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

The description says 'Offline' while annotations declare openWorldHint=true, a direct contradiction. Although it adds useful details about return formats and calendar-aware behavior, the rubric requires a 1 for annotation contradictions.

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?

The description is front-loaded and information-dense with no filler sentences. The long format enumeration is heavy but appropriate for a parser tool.

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

Completeness3/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 helpfully lists return components and calendar-aware date math. Still, unsupported optional parameters and the offline/openWorld contradiction leave meaningful gaps for correct invocation.

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 coverage is 100% for the single parameter d, and the description usefully enriches it with format examples. However, it also mentions optional unit, start, and direction parameters that are absent from the schema, creating invocation ambiguity.

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 (parse/convert) and resource (duration), enumerating accepted formats and outputs. It does not name sibling alternatives, so differentiation is implicit rather than explicit.

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?

The accepted inputs imply use for duration parsing and conversion, but there is no explicit when-to-use, when-not, or comparison to siblings such as time_convert or time_date_math.

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