Skip to main content
Glama
Date Math – Business Days, Holidays & Time Zones

Date Math – Business Days, Holidays & Time Zones

Parse natural-language dates

parse_date_text
Read-onlyIdempotent

Convert natural-language dates and relative times like "next Friday at 3pm" or "in 2 weeks" into exact ISO datetimes using a reference time and time zone. Use it before acting on any date a user typed.

Instructions

Parse natural-language dates and relative times like "next Friday at 3pm", "in 2 weeks", "tomorrow morning" or "Dec 25 to Jan 2" into exact ISO datetimes, relative to a reference time and time zone. Use before acting on any date a user typed. First 25 calls per day are free, then $0.001 per call (x402).

Input Schema

NameRequiredDescriptionDefault
textYes
timezoneNoDefault UTC
referenceNoISO 8601 datetime the text is relative to; default now
forward_dateNoPrefer future dates for ambiguous text (default true)

Output Schema

NameRequiredDescriptionDefault
textYes
countYes
resultsYes
timezoneYes
referenceNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, and the description correctly adds economic context the annotations cannot carry: a free tier of 25 calls/day, then $0.001 per call via x402. That cost signal is genuinely decision-relevant, but the description says nothing about failure behavior for unparseable or ambiguous text, which matters for a parser.

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, both earning their place: the first front-loads purpose with illustrative examples, the second front-loads the usage rule and appends the cost caveat. No redundant restatement of the name or title.

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?

The tool is simple, has only 4 parameters with 75% schema coverage, and an output schema exists that explains return values, so the description does not need to. The only material gap is how ambiguous or invalid input is handled, which is a minor omission for a parsing utility.

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 75%, near the threshold where the schema does most of the work. The description adds conceptual framing — results are computed "relative to a reference time and time zone" — which reinforces the timezone and reference parameters, but it adds no format, default, or edge-case detail beyond what the schema already states.

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 specific verb+resource (parse natural-language dates into exact ISO datetimes) and grounds it with four concrete input examples, including a range case. This clearly separates it from the arithmetic siblings (date_add, date_diff) and the lookup siblings (public_holidays, timezone_convert).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"Use before acting on any date a user typed" gives a clear triggering condition and implicitly frames it as a preprocessing step. However, it never names an alternative or a when-not case, so an agent deciding between this and date_info or timezone_convert for an already-structured date gets no explicit routing.

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