Skip to main content
Glama
Date Math – Business Days, Holidays & Time Zones

Date Math – Business Days, Holidays & Time Zones

Payroll and billing dates

pay_dates
Read-onlyIdempotent

Calculate upcoming pay and billing dates for weekly, biweekly, monthly, or semi-monthly schedules, adjusting dates off weekends and public holidays for payroll, invoices, and recurring billing.

Instructions

Upcoming pay or billing dates for monthly, semi-monthly (e.g. 15th and last day), biweekly or weekly schedules, moved off weekends and public holidays (to the previous, next or nearest business day). Use for payroll calendars, invoice due dates and recurring billing. First 25 calls per day are free, then $0.001 per call (x402).

Input Schema

NameRequiredDescriptionDefault
daysNomonthly: 1 day, semi_monthly: 2 days of the month (1–31 or "last"; 31 clamps to month end). Defaults: ["last"] and [15, "last"]
fromYes
countNoHow many pay dates to return
adjustNoWhere to move a pay date that falls on a weekend or holidayprevious
anchorNo
countryNoISO 3166-1 alpha-2 country code (207 countries); its public holidays (2000–2050) are excluded from business days
holidaysNoExtra dates excluded from business-day counts (rest days from workdays are always excluded)
scheduleYes
workdaysNoWorking days of the week, 0 = Sunday. Default [1,2,3,4,5] (Mon–Fri); e.g. [0,1,2,3,4] for Sun–Thu or [1,2,3,4,5,6] for Mon–Sat

Output Schema

NameRequiredDescriptionDefault
countYes
adjustYes
scheduleYes
pay_datesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so safety is covered. The description adds genuinely new behavioral information: weekend/public-holiday dates are moved (default previous) and there is a metered cost model (25 free calls/day, then $0.001 via x402), which an agent cannot infer from the annotations or schema.

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?

Three sentences, front-loaded with what the tool returns before the use cases and the cost caveat; nothing is padding. Sentence 1 is dense with nested parentheses but still readable, and the pricing note is short enough to justify its place.

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?

An output schema exists, so return values need no explanation, and the schedule/shift semantics are covered. However, with 9 parameters the description never explains `anchor` (the seed date that determines phase for biweekly/weekly) or how `from` differs from it, leaving a calling-critical gap for the recurrence modes it advertises.

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 description coverage is 67% and the description only echoes what the schema already documents (the 15th-and-last-day semi-monthly example parallels the `days` description; the shift directions parallel the `adjust` enum). It adds no meaning for the undocumented `from` vs `anchor` distinction, which is the main semantic risk with biweekly/weekly schedules.

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 (upcoming pay or billing dates) and enumerates the exact schedule families supported (monthly, semi-monthly, biweekly, weekly) plus the holiday/weekend shift rule. The payroll/invoice framing distinguishes it from generic recurrence tooling such as recurring_dates or business_day.

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

Usage Guidelines4/5

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

"Use for payroll calendars, invoice due dates and recurring billing" gives clear positive usage context. It stops short of naming alternatives (e.g. recurring_dates for non-payroll recurrence, public_holidays for listing holidays themselves) or stating when this tool is the wrong choice, so it is context-clear but not fully routing.

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