Skip to main content
Glama

calculate_date

Read-only

Get the current date and time, or do calendar math exactly, DST-aware. action=now: the current time in tz. action=add: shifts date by the add object, e.g. {"months": 1} or {"business_days": 10}; month ends are clamped (Jan 31 + 1 month = Feb 28). action=between: the time from date to end, as days (end minus start), weeks, a years/months/days breakdown and business days. Business days are Monday to Friday counted after the start day, with no holidays. If end is earlier, the numbers are negative and the result says "direction": "backward". action=info: weekday, week number and quarter of date, converted to to_tz if given. A date with its own offset keeps it; others are read in tz. Use this instead of guessing today's date or counting days yourself; use calculate_expression for plain numbers. Dates in almost any format are accepted; ambiguous ones like 03/04/2026 are read month-first unless dayfirst=true, and notes say how input was read. Missing or unreadable inputs return an error naming the parameter.

Input Schema

NameRequiredDescriptionDefault
tzNonow: the zone to answer in. Others: the zone of dates that don't state one. IANA ("Asia/Tokyo"), offset or abbreviation. Default UTC.
addNoadd (required): years, months, weeks, days, hours, minutes, seconds or business_days; negative to subtract.
endNobetween: the end date (required).
dateNoadd, between (start), info: required. e.g. "2026-10-07" or "Oct 7 2026 9am".
to_tzNoinfo: convert to this zone.
actionYes
dayfirstNoRead 03/04/2026 as 3 April.

Output Schema

NameRequiredDescriptionDefault
notesNoHow an ambiguous input was read.
valueYesnow/add/info: iso, date, weekday, time, tz, utc_offset, iso_week, quarter. between: days, weeks, breakdown, business_days, direction (forward or backward).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already carry the safe-read profile (readOnlyHint=true, destructiveHint=false), and the description still adds substantial behavior: DST-awareness, month-end clamping (Jan 31 + 1 month = Feb 28), the Monday–Friday/no-holidays business-day rule, negative/backward results when end < start, month-first parsing of ambiguous dates unless dayfirst=true, and error behavior that names the malformed parameter.

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?

Single dense paragraph where nearly every sentence maps to an action or an edge case, so little is wasted and the main use case is front-loaded. It could be tightened with action-keyed fragments, but length is proportionate to four modes and seven parameters.

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?

An output schema exists, so return-value documentation is unnecessary, and annotations cover the safety profile. For a four-mode, seven-parameter tool the description covers mode selection, required inputs, edge cases, parsing ambiguity and failure behavior — nothing an agent needs to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 86%, yet the description meaningfully extends it: the shape of the add object with worked examples, the clamping rule, what tz means for now vs. other actions, when dayfirst applies, and which parameters each action requires. This goes well beyond restating the schema strings.

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?

Opens with a specific verb+resource ('get the current date and time, or do calendar math exactly, DST-aware') and then enumerates the four action modes, each with its own semantics. It explicitly separates itself from the sibling calculate_expression ('use calculate_expression for plain numbers'), so an agent can route without opening either schema.

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?

States the operative context directly ('use this instead of guessing today's date or counting days yourself') and names the alternative tool and the condition that selects it. Each action (now/add/between/info) is described with its required inputs, which functions as per-mode usage guidance.

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