# calculate_date_difference

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

Agent View of the PolicyLayer registry record for `calculate_date_difference`. HTML page: https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-date-difference

## Facts

- Tool: `calculate_date_difference`
- Server: Calcgrid (`https://tttkmbb.com/mcp`) — https://policylayer.com/tools/com-tttkmbb-calcgrid.md
- Homepage: https://github.com/https://tttkmbb.com/mcp
- Risk category: Write (Medium risk)
- Registry record: grade D, identity unverified
- Server auth posture: open
- Server CORS policy: *
- Server rate-limited: no
- Parameters: 3 (2 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `end_date` | string | yes | Second date (YYYY-MM-DD). If it is earlier than start_date the dates are swapped and a note is returned. |
| `start_date` | string | yes | First date (ISO 8601, YYYY-MM-DD). |
| `include_end_date` | boolean | no | true counts both endpoints (adds one day to days, weeks/days and business_days), e.g. for inclusive rental or leave periods. |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "calculate_date_difference",
    "arguments": {
      "end_date": "<end_date>",
      "start_date": "<start_date>"
    }
  }
}
```

## Why calculate_date_difference is rated Medium

An AI agent can call calculate_date_difference faster than any human can review: one bad instruction and it creates or modifies resources in Calcgrid by the hundred, each call as confident as the last.

## Use case

AI agents use calculate_date_difference to create or update resources in Calcgrid, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Calcgrid environment.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Calcgrid:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "calculate_date_difference": {
      "limits": [
        {
          "counter": "calculate_date_difference_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Calcgrid (252)

- `calculate_bazi_four_pillars` — Execute — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-bazi-four-pillars.md
- `run_calculator` — Execute — https://policylayer.com/tools/com-tttkmbb-calcgrid/run-calculator.md
- `calculate_ab_test_significance` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-ab-test-significance.md
- `calculate_age` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-age.md
- `calculate_bmi` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-bmi.md
- `calculate_bmr` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-bmr.md
- `calculate_circle_properties` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-circle-properties.md
- `calculate_compound_interest` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-compound-interest.md
- `calculate_depth_of_field` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-depth-of-field.md
- `calculate_haversine_distance` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-haversine-distance.md
- `calculate_kinetic_energy` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-kinetic-energy.md
- `calculate_loan_payment` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-loan-payment.md
- `calculate_molar_mass` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-molar-mass.md
- `calculate_mortgage_payment` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-mortgage-payment.md
- `calculate_percentage` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-percentage.md
- `calculate_percentage_change` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-percentage-change.md
- `calculate_running_pace` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-running-pace.md
- `calculate_subnet` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-subnet.md
- `calculate_t_test` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-t-test.md
- `calculate_tdee` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/calculate-tdee.md
- `cast_plum_blossom_hexagram` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/cast-plum-blossom-hexagram.md
- `check_ar_working_day` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/check-ar-working-day.md
- `check_at_working_day` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/check-at-working-day.md
- `check_australia_working_day` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/check-australia-working-day.md
- `check_bd_working_day` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/check-bd-working-day.md
- `check_be_working_day` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/check-be-working-day.md
- `check_bg_working_day` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/check-bg-working-day.md
- `check_br_working_day` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/check-br-working-day.md
- `check_canada_federal_working_day` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/check-canada-federal-working-day.md
- `check_ch_working_day` — Read — https://policylayer.com/tools/com-tttkmbb-calcgrid/check-ch-working-day.md
- …and 222 more: https://policylayer.com/tools/com-tttkmbb-calcgrid.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=com-tttkmbb-calcgrid · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/com-tttkmbb-calcgrid
