Skip to main content
Glama

Parse a duration

parse_duration
Read-onlyIdempotent

Convert duration strings like "1h30", "1:30", or "2.5" into whole minutes for UseHourly, so time entries are parsed correctly for logging and invoicing.

Instructions

Turn text like "1h30", "1:30" or "2.5" into whole minutes, the way UseHourly reads it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe duration text to read, e.g. 1h30

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
hoursNo
minutesYesWhole minutes, or null when the text could not be read

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower. The description adds genuinely non-structured context: the output unit is whole minutes and the parsing convention is 'the way UseHourly reads it', which tells the agent the app-specific format is authoritative. It does not say what happens on invalid input, keeping it from a 5.

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?

One sentence, front-loaded with the concrete format examples, with zero filler. Every clause carries information.

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?

An output schema exists, so return values needn't be explained, and the description supplies the unit and parsing convention. The only material gap is error behaviour for malformed input, which is minor for a pure read-only conversion utility.

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% for the single 'text' parameter, so the baseline is 3. The description earns an extra point by enumerating formats ('1h30', '1:30', '2.5') that the schema only partially shows (schema example is just '1h30'), clarifying the accepted grammar.

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 precise verb (turn/convert), the input form (duration text), the output unit (whole minutes), and names three concrete example formats. No sibling tool in the list does anything comparable, so it is trivially distinguishable.

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?

Usage is implied by the naming of input formats, but there is no explicit 'use this when...' or indication of what to do with unparseable input, nor any comparison to alternatives (none exist, but that isn't stated). Adequate but leaves routing to inference.

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