Skip to main content
Glama

Days between two dates

days_between
Read-onlyIdempotent

Signed whole calendar days from the from date to the to date, midnight to midnight in tz: positive when to is later, negative when it is earlier. Endpoints are exclusive, so this is the gap and consecutive dates are 1 apart. Either date may be "today", resolved in tz. For working days between two dates use business_days; to move a date by N days use add_days or subtract_days.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesISO date YYYY-MM-DD, or "today" (resolved in tz)
tzNoIANA timezone that defines "today" (e.g. Africa/Kampala). Default UTC.UTC
fromYesISO date YYYY-MM-DD, or "today" (resolved in tz)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
answerYesThe calculated answer (kind-discriminated)
receiptYesAuditable receipt: inputs, timezone, convention, workweek, holiday calendar, exclusions, versions, stable result ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • removedInput schema / properties / to / $ref
      Removed value: -"#/properties/from"
    • addedInput schema / properties / to / description
      Added value: +"ISO date YYYY-MM-DD, or \"today\" (resolved in tz)"
    • addedInput schema / properties / to / pattern
      Added value: +"^(\\d{4}-\\d{2}-\\d{2}|today)$"
    • addedInput schema / properties / to / type
      Added value: +"string"
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

The annotations already declare readOnly and idempotent behavior, and the description adds valuable semantics: midnight-to-midnight in tz, exclusive endpoints, consecutive dates are 1 apart, and 'today' resolution. No behavioral surprises remain.

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?

Four sentences, each earning its place: core semantics, endpoint exclusivity, 'today' behavior, and sibling routing. The most important information is front-loaded, with alternatives at the end.

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

Completeness5/5

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

For a simple pure-computation tool with an output schema and strong annotations, this description covers every aspect an agent needs: result sign, interval semantics, timezone handling, and alternative tools. Nothing essential is missing.

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% and each parameter has a good description, so the baseline is 3. The description adds extra meaning by explaining the relationship between from and to (signed result, which direction is positive) and clarifying that either date can be 'today' resolved in tz.

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 and resource: computes 'signed whole calendar days from the from date to the to date'. The semantics are precise — positive when to is later, negative when earlier — and the title is reinforced rather than merely restated.

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

Usage Guidelines5/5

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

Explicitly names alternatives and the conditions for choosing them: 'For working days between two dates use business_days; to move a date by N days use add_days or subtract_days.' This fully disambiguates the tool from its siblings.

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.

Resources