API & MCP
Everything a person can do on Timeslice Duration & Time Range Parser, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://timeslicedurationparser.usefulweb.app/api/v1/calculate– run Timeslice Duration & Time Range ParserGET https://timeslicedurationparser.usefulweb.app/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Timeslice Duration & Time Range Parser
Reads durations and time ranges the way people type them — 1h30, 1 hour 30 minutes, 90m, 1:30, 1,5 h, PT1H30M, 9-10:30, 9am to 1pm, 22:00-02:00, 14:00 + 45m — one per line, and returns each as h:mm, decimal hours and an ISO 8601 duration, with the total and how every line was read.
| Field | Type | Default | Description |
|---|---|---|---|
lines | textarea | "1h30\n90m\n2:15\n1,5 h\n9-10:30\n9am to 1pm\n22:00-02:00\n14:00 + 45m" | Durations or time ranges (one per line). Durations: 1h30, 1h 30m, 90m, 1:30, 1.5 (a bare number up to 10 is hours, larger whole numbers are minutes), PT1H30M. Ranges: 9-10:30, 9:00–17:30, 9am to 1pm, 14:00 + 45m. |
clock | select (24, 12) | "24" | Show times as |
roundMinutes | select (0, 5, 6, 15, 30) | "0" | Round each line to |
Example request
Mixed ways of writing time
curl -X POST https://timeslicedurationparser.usefulweb.app/api/v1/calculate -H 'content-type: application/json' -d '{"lines":"1h30\n90m\n2:15\n1,5 h\n9-10:30\n9am to 1pm\n22:00-02:00\n14:00 + 45m"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://timeslicedurationparser.usefulweb.app/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
timeslice_duration_parser - Local stdio connector:
node src/mcp-stdio.ts --tool=timeslice-duration-parser
{
"mcpServers": {
"timeslice-duration-parser": { "type": "http", "url": "https://timeslicedurationparser.usefulweb.app/mcp" }
}
}