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 ...
This record as markdown: /tools/com-tttkmbb-calcgrid/calculate-date-difference.md
What calculate_date_difference does on Calcgrid
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.
| 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 | — | 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.
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.
Attacks that exploit this kind of access
The rule that runs calculate_date_difference safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Calcgrid, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For calculate_date_difference, this is the rule to start with:
calculate_date_difference stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Calcgrid, apply this rule, and every calculate_date_difference call is checked against it from then on.
Questions about 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. It is categorised as a Write tool in the Calcgrid MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
calculate_date_difference accepts 3 parameters: end_date, start_date, include_end_date. Required: end_date, start_date. The full parameter table on this page comes from the server's own tool schema.
Register the Calcgrid MCP server in PolicyLayer and add a rule for calculate_date_difference: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Calcgrid. Nothing to install.
calculate_date_difference is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the calculate_date_difference rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for calculate_date_difference. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
calculate_date_difference is provided by the Calcgrid MCP server (https://tttkmbb.com/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Calcgrid, and thousands of servers like it.
This server
Across the catalogue