parse_duration
Converts human-readable duration strings like '2h30m' or '1d6h' into total seconds, enabling arithmetic and comparison of free-text durations.
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'. Returns the total seconds for the duration. Use when normalising a free-text duration for arithmetic or comparison.
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_string": "<duration_string>"
},
"name": "parse_duration"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| duration_string | Yes | Duration string like "2h30m", "1d6h", "45m". |