Skip to main content
Glama

Date and business-day calculator

date_calc
Read-only

Calculate days or business days between dates, add or subtract days while skipping weekends and country holidays, and get date facts such as weekday, ISO week, quarter, and leap year.

Instructions

Date math agents get wrong: days and business days between two dates (skipping weekends and a country's nationwide public holidays, looked up for the start and end year), add or subtract days or business days, and facts about a date (weekday, ISO week, quarter, day of year, leap year). Costs $0.001 per call.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "op": "<op>",
      "date": "<date>"
    },
    "name": "date_calc"
  }
}

Input Schema

NameRequiredDescriptionDefault
opYes"diff", "add_days", "add_business_days" or "info".
dateYesStart date, YYYY-MM-DD.
daysNoDays to add (negative to subtract).
countryNoSkip this country's public holidays in business-day math, e.g. "US".
end_dateNoEnd date for diff, YYYY-MM-DD.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, and the description stays consistent with that. It adds genuinely useful behavior beyond the annotations: business-day math skips weekends plus a country's nationwide public holidays, and those holidays are resolved for both the start and end year — a subtlety an agent would otherwise miss. It also discloses the $0.001 per-call cost, which is real invocation context.

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?

A single dense sentence, front-loaded with the value proposition and then a compact enumeration of operations, followed by the cost. The "agents get wrong" framing is slightly promotional, but every clause carries information and nothing is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description carries the burden of explaining return values, and it does not — an agent can't tell whether `diff` returns an integer, whether `info` returns an object, or whether business-day results include holiday names. For a read-only calculator with fully documented params this is adequate but leaves a real gap.

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%, so the schema already documents all five parameters and the enum values, making 3 the baseline. The description does add a little meaning, notably that holiday lookup spans the start and end year, but it doesn't explain the diff/add/info parameter-to-operation mapping beyond what the field descriptions imply.

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?

Names a specific resource (dates) and enumerates the concrete operations: day/business-day diffs, add/subtract, and date facts like weekday, ISO week, quarter, day of year, and leap year. The operation list maps directly onto the four `op` enum values, so an agent can tell this apart from the numeric `math_calc` sibling without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The opening clause ("Date math agents get wrong") implies when the tool is worth reaching for, and the operations hint at which `op` to choose. But it never states when-not to use it, nor which parameters each operation requires (e.g. that `diff` needs `end_date`, `add_*` needs `days`, `info` needs neither).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.