Skip to main content
Glama

Date math: durations & business days (paid $0.001)

datemath

PAID $0.001. Calendar date math. op='add'/'subtract' an ISO-8601 duration (P1Y2M10DT2H30M) to a date; op='diff' two datetimes into chosen units; op='business-add' add business days (configurable weekend + holidays); op='business-diff' count business days between two dates. Without payment returns the x402 challenge; pass x_payment to settle.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYesadd | subtract | diff | business-add | business-diff
toNoEnd datetime for diff/business-diff.
dateNoBase date for add/subtract/business-add (ISO 8601).
daysNoBusiness days to add (business-add; may be negative).
fromNoStart datetime for diff/business-diff.
unitsNodiff units, e.g. ['days','hours'].
weekendNoWeekend weekdays (1=Mon..7=Sun; default [6,7]).
durationNoISO-8601 duration string or object for add/subtract.
holidaysNoISO dates to skip as holidays.
timezoneNoIANA zone for parsing/rendering.
x_paymentNox402 payment payload (base64) for this PAID tool. If supplied it is forwarded as the X-PAYMENT header to settle the $0.001 call and return the real result instead of a 402 challenge. Omit to get the price challenge first.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly reveals the paid nature ($0.001), the x402 challenge behavior, and the requirement to pass x_payment to settle. It also notes configurable weekend and holidays. The main gap is that it does not describe the return format for each operation, which would be important for an agent consuming the result.

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?

The description is a single well-structured paragraph that front-loads the critical payment warning, then enumerates the four operations and their key parameters. Every sentence is substantive, with no filler or redundancy, making it easy to scan for relevant operation details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the core logic (operations, payment flow) and the schema handles parameter documentation, but there is no output schema. The description does not specify the return value shape (e.g., a string for add/subtract, an object for diff), which is a notable gap for an agent that needs to interpret results. Overall, it is adequate for tool selection and basic invocation but not fully complete.

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?

The input schema covers all 11 parameters with 100% description coverage, so the description adds little semantic value beyond what is already structured. It does mention the ISO-8601 duration format and operation-specific parameter groupings, but these are also present in the schema. Thus, the baseline score of 3 is appropriate.

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?

The description clearly identifies the tool as calendar date math and enumerates four distinct operations (add/subtract, diff, business-add, business-diff) with their respective inputs. This specific verb+resource pairing distinguishes it from sibling tools like timezone, cron, and rrule, making its purpose unmistakable.

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?

The description gives concrete usage context by listing each operation and its required parameters (e.g., 'op='add'/'subtract' an ISO-8601 duration to a date'). It also explains the payment flow, guiding whether to expect a challenge or pass x_payment. However, it does not explicitly state when not to use this tool versus alternatives like diff or timezone, though the sibling context implies these are distinct.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A4.1/5.0
Disambiguation5/5

Each tool targets a distinct operation: unit conversion, cron parsing, currency conversion, date math, diff, encoding, hashing, ID generation, JSON schema validation, regex, RRULE expansion, text transforms, and timezone conversion. Even related tools like convert, currency, and timezone are clearly separated by domain, with descriptions that eliminate ambiguity.

Naming Consistency5/5

All tool names are lowercase single-word identifiers without separators or camelCase, forming a clean and predictable pattern. While some are verbs (convert, diff, encode) and others nouns (cron, currency, id), the uniform naming style ensures consistency.

Tool Count5/5

13 tools is well-scoped for a general-purpose utility belt. Each tool covers a common utility without redundancy, fitting comfortably within the ideal 3-15 range.

Completeness5/5

The tool surface covers a broad range of utilities: unit and currency conversion, date/time handling (datemath, timezone, cron, rrule), text processing (text, encode, regex, diff), cryptography (hash), ID generation, and schema validation. No obvious gaps exist for the stated purpose.