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

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +  }
      +]
  2. Added
  3. Removed
  4. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already mark it read-only and idempotent, and the description adds meaningful behavioral detail beyond that: date swapping when end_date is earlier, business days being Monday–Friday with public holidays not excluded, and the exact formula including the inclusive-endpoint effect. No contradictions with annotations.

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 structured with clear sections: usage, exclusion, computation, inputs, examples, outputs, formula, fallback, and docs. The most decision-relevant guidance is front-loaded, and each section earns its place.

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 tool with rich annotations, a complete input schema, and an output schema, the description is exceptionally complete. It covers edge cases, formula, examples, output fields, and even a REST fallback, so an agent has everything needed to invoke it correctly.

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%, so the baseline is 3. The description adds value by spelling out the calculation formula, clarifying how include_end_date changes results, and providing complete JSON examples. Most of the parameter meaning is in the schema, but the formula and business-day definition go beyond it.

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 computes: number of days, weeks, working days, or calendar-style differences between two dates. It also distinguishes itself from nearby concepts like adding/subtracting days and calculating age.

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 explicitly says when to use the tool ('Use this when you need...') and when not to use it, naming alternatives: '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).' This is model behavior for routing.

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