Skip to main content
Glama

Date Difference Calculator

calculate_date_difference
Read-onlyIdempotent

Use this when you need the number of days, weeks or working days between two dates, or a calendar-style 'x years y months z days' difference. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.

Do not use this when you want to add or subtract a number of days from a date (use add-days), or you need an age with the next birthday (use age). What it computes: Counts the days between two ISO dates and expresses the gap as weeks and days, as a calendar breakdown in years, months and days, and as business days (Monday–Friday, public holidays not excluded). Inputs: start_date (date); end_date (date); include_end_date (boolean, optional). Complete JSON argument examples: {"start_date":"2026-01-01","end_date":"2026-12-25"} | {"start_date":"2025-11-05","end_date":"2026-03-15","include_end_date":true} Outputs: days [days], weeks [weeks], remaining_days [days], weeks_and_days, calendar_years, calendar_months, calendar_days, calendar_text, business_days [days]. Formula: days = end_date − start_date (+1 if include_end_date); weeks = floor(days / 7); remaining_days = days mod 7; business_days = number of Mon–Fri dates in [start_date, end_date) or [start_date, end_date] when inclusive; calendar breakdown = whole years, months, then days borrowed from the month before end_date Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/date-difference with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/everyday/date-difference.md

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
end_dateYesSecond date (YYYY-MM-DD). If it is earlier than start_date the dates are swapped and a note is returned.
start_dateYesFirst date (ISO 8601, YYYY-MM-DD).
include_end_dateNotrue counts both endpoints (adds one day to days, weeks/days and business_days), e.g. for inclusive rental or leave periods.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
linksNo
resultYes
requestYes
sourcesNo
successYes
versionNo
freshnessNo
timestampYes
next_actionsNo
service_versionYesDeployed Calcgrid implementation version used for the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / service_version
      Added value: +{
      +  "description": "Deployed Calcgrid implementation version used for the result.",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "success",
      -  "request",
      -  "result",
      -  "timestamp"
      -]New value: +[
      +  "success",
      +  "service_version",
      +  "request",
      +  "result",
      +  "timestamp"
      +]
  2. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "end_date": "2026-12-25",
      +    "start_date": "2026-01-01"
      +  },
      +  {
      +    "end_date": "2026-03-15",
      +    "include_end_date": true,
      +    "start_date": "2025-11-05"
      +  }
      +]
  3. Added
  4. Removed
  5. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is clear. The description adds substantial behavioral detail: it counts business days (Mon–Fri, no holidays), swaps dates if end is earlier, and explains the effect of include_end_date. This goes well beyond annotations and gives the agent a complete picture of behavior.

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?

The description is longer than average but well-structured: it front-loads the primary purpose, then exclusions, then computational details, outputs, and fallback. Every section carries useful information; however, the formula and output field list could be seen as redundant given the output schema and the formula is not necessary for the agent to call correctly. Still, it remains efficient and organized.

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?

Given the tool's complexity (multiple output formats, inclusive date handling, business days, date swapping), the description is remarkably complete. It explains all outputs, the formula, the inclusive behavior, and even provides a REST fallback and documentation link. An output schema exists, so return values are covered there; nothing an agent needs is missing.

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% and the schema descriptions are already detailed (e.g., include_end_date explains 'true counts both endpoints...'). The description largely repeats the parameter meanings and adds complete JSON examples, which are helpful but not semantically new. Per calibration, with full schema coverage the baseline is 3, and the description does not elevate it further.

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 opens with a precise statement of what the tool does: 'the number of days, weeks or working days between two dates, or a calendar-style difference.' It uses a specific verb ('calculate'), names the resource (dates), and explicitly distinguishes from siblings by naming add-days and age. This leaves no ambiguity about the tool's function.

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?

It gives explicit when-to-use guidance ('Use this when you need...') and when-not-to-use guidance ('Do not use this when you want to add or subtract... use add-days, or you need an age... use age'). It also provides direct REST fallback and a docs link, covering alternatives and edge-case behavior thoroughly.

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