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

Date Math – Business Days, Holidays & Time Zones

Subscription renewal and proration

subscription_dates
Read-onlyIdempotent

Calculate subscription billing periods, upcoming renewals, cancel-by dates, trial starts, and prorated charges from a start date; month-end anchors stay at month end.

Instructions

Subscription and contract date math: current billing period, next renewal, upcoming renewals, cancel-by date for a notice period, free-trial start, and day-based proration of a price. Month-end anchors stay at month end (Jan 31, Feb 28, Mar 31). Use for SaaS billing, renewals, cancellation deadlines and refunds. First 25 calls per day are free, then $0.001 per call (x402).

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": {
      "start": "<start>"
    },
    "name": "subscription_dates"
  }
}

Input Schema

NameRequiredDescriptionDefault
as_ofNo
countNoUpcoming renewals to list
startYes
amountNoPrice of one billing period, for proration
intervalNomonth
trial_daysNoFree trial length; billing starts after it
notice_daysNoCancellation notice period before renewal
interval_countNoe.g. 3 with month = quarterly

Output Schema

NameRequiredDescriptionDefault
noteYes
as_ofYes
startYes
statusYes
intervalYes
cancel_byYesLast day to cancel before the next renewal, given notice_days
prorationYes
next_renewalYes
billing_startYes
current_periodYes
interval_countYes
cancel_by_passedYes
upcoming_renewalsYes
next_renewal_weekdayYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.7.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, closed-world), and the description adds genuinely new traits beyond them: the month-end anchor rule (Jan 31 → Feb 28 → Mar 31) and a concrete rate-limit/cost model (25 free calls/day, then $0.001 per call via x402). It does not discuss error behavior or how invalid combinations are handled, so it falls just short of full disclosure.

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?

Front-loaded with the capability list, then domain guidance, then the edge-case rule and cost note. Four dense sentences with little waste, though the pricing/x402 sentence is tangential to correct invocation and could be separated as a note.

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

Completeness4/5

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

For an 8-parameter tool with an output schema and full annotations, the description covers purpose, domain fit, a subtle calendar edge case, and operating cost. The remaining gap is guidance on which parameters combine for which mode (e.g., amount+interval for proration, notice_days for cancel-by), which leaves mode selection partly to inference.

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 63%, and the description implicitly maps to several parameters (notice period → notice_days, free trial → trial_days, proration of a price → amount + interval). However, it never explains as_of, count, or interval_count, so roughly a third of the surface remains undocumented in both places. Baseline 3 is appropriate.

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 ("Subscription and contract date math") and enumerates the concrete outputs: current billing period, next renewal, upcoming renewals, cancel-by date, trial start, and proration. The domain framing makes it distinguishable from generic date siblings such as date_add, recurring_dates and date_diff without opening a schema.

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?

Gives explicit use cases ("SaaS billing, renewals, cancellation deadlines and refunds"), which is clear when-to-use guidance. It stops short of naming when not to use it or routing to a specific sibling like recurring_dates for plain recurrence expansion.

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