Skip to main content
Glama

Difference between two dates

date_difference
Read-onlyIdempotent

Count calendar days, elapsed time, and business days between two dates. Business days skip weekends and any YYYY-MM-DD holidays you list.

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": {
      "startDate": "<startDate>",
      "endDate": "<endDate>"
    },
    "name": "date_difference"
  }
}

Input Schema

NameRequiredDescriptionDefault
endDateYesEnd date as YYYY-MM-DD.
endTimeNoEnd time as HH:MM or HH:MM:SS. Defaults to midnight.
holidaysNoWeekday holidays to exclude from business days, one YYYY-MM-DD per line.
startDateYesStart date as YYYY-MM-DD.
startTimeNoStart time as HH:MM or HH:MM:SS. Defaults to midnight.
includeEndNoCount the end date as well as the days between.

Output Schema

NameRequiredDescriptionDefault
daysYes
signYes
hoursYes
weeksYes
yearsYes
monthsYes
minutesYes
secondsYes
extraDaysYes
totalDaysYes
totalHoursYes
countedDaysYes
holidayDaysYes
weekendDaysYes
businessDaysYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  2. First observed

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already establish readOnly, idempotent, closed-world behavior, so the safety profile is fully covered without prose. The description adds genuine behavioral context by defining business-day semantics (weekends skipped, listed YYYY-MM-DD holidays excluded), but it stays silent on time zones, what happens when the end precedes the start, and whether the three counts are returned together.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences with no filler, leading with the three computation modes before the qualifying rule for business days. Nothing is redundant, though the second sentence could be folded into the first without loss.

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?

With an output schema present, return values need not be described, and the description adequately frames the core computation. For a six-parameter date calculator, though, it omits the time-of-day inputs and the includeEnd flag entirely, leaving the agent to discover that elapsed time depends on optional time parameters only by reading the schema.

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 100%, so every parameter, including startTime/endTime and includeEnd, is already documented in the schema. The description reinforces the holidays parameter but adds no new meaning beyond the schema's own text ("Weekday holidays to exclude from business days, one YYYY-MM-DD per line"), and never mentions the time or inclusive-end options at all. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb ("Count") and the exact quantities produced (calendar days, elapsed time, business days between two dates), so an agent knows precisely what computation this performs. It does not try to distinguish itself from any sibling, though none of the listed siblings closely overlaps, so the risk of misrouting is low.

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

Usage Guidelines3/5

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

Usage is implied by the statement of what gets counted — an agent can infer it should use this whenever a difference between two dates is needed. However, there is no explicit when-to-use framing, no prerequisites, and no statement of when a different tool (e.g. convert_unix_timestamp) would be preferable.

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.