Skip to main content
Glama

parse_duration

Read-onlyIdempotent

Convert human-readable duration strings like "2h30m" or "1d6h" to total seconds for time estimation and scheduling.

Instructions

Parses a human-readable duration string into structured seconds. Supports combinations of y (years), mo (months), w (weeks), d (days), h (hours), m (minutes), s (seconds). Examples: '2h30m', '1d6h', '1w3d', '45m'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
duration_stringYesDuration string like "2h30m", "1d6h", "45m".
Behavior3/5

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

Annotations already mark the tool as read-only, non-destructive, and idempotent. The description adds supported units and examples, which supplements but does not extend behavioral transparency beyond what annotations imply.

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?

Two sentences: first states purpose and supported units, second provides examples. Every sentence is informative with no redundancy. Front-loaded with the core action.

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?

Given one required parameter with full schema coverage, no output schema, and complete annotations, the description sufficiently explains the tool's behavior and input format. No gaps remain.

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 description coverage is 100%, so schema explains the parameter. The description adds meaning with allowed units and examples, helping the agent understand valid input formats beyond the schema.

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?

Description clearly states the tool parses human-readable duration strings into seconds, lists supported units (y, mo, w, d, h, m, s), and provides concrete examples. The unique function stands out among siblings like convert_timezone or time_math.

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 description implies use for converting duration strings but does not explicitly contrast with siblings (e.g., when to parse vs. compute time differences). No when-not-to-use or alternative tool guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/KyaniteLabs/Epoch'

If you have feedback or need assistance with the MCP directory API, please join our Discord server