Skip to main content
Glama

Calculate Proration

calculate_proration
Read-onlyIdempotent

Prorate a mid-period plan change (upgrade, downgrade, seat change): credit for the unused part of the old plan, charge for the rest of the period on the new plan, and the net amount. Method "months" (default) counts every whole month of the period equally and splits only the partial month by its own days; "days" spreads the price over every day of the period (Stripe default). Monthly plans give the same answer either way. Same math as revexos.com/proration-calculator.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cycleYesBilling period length.
methodNo"months" (default) or "days".
new_priceYesPrice per unit of the new plan for one full period.
old_priceYesPrice per unit of the current plan for one full period.
change_dateYesDate the change takes effect, YYYY-MM-DD. Must fall inside the period.
new_quantityNoUnits/seats on the new plan. Default 1.
old_quantityNoUnits/seats on the current plan. Default 1.
period_startYesStart date of the current billing period, YYYY-MM-DD.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnly, idempotent, closed-world), and the description adds genuine behavioral substance beyond them: exactly what is computed (credit for unused old plan, charge for the remainder on the new plan, net amount) and how each method treats whole vs partial periods. This is valuable because there is no output schema defining the result.

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?

Two tightly packed sentences, front-loaded with the operation and followed by method semantics; almost every clause earns its place. The closing reference to an external calculator URL is the one element that adds little for an agent.

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?

With no output schema, the description carries the burden of describing the result and does so (credit, charge, net amount). All 8 parameters are documented in-schema, edge cases are noted, and method behavior is fully specified.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description goes further by explaining what 'months' vs 'days' actually do mathematically and flagging 'days' as the Stripe default — meaning the schema's terse '"months" (default) or "days"' never conveys. Quantity defaults are left to the schema, which documents them adequately.

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?

States a specific verb ('Prorate') and resource ('a mid-period plan change') and immediately enumerates the covered cases (upgrade, downgrade, seat change). An agent can distinguish it from siblings like calculate_invoice_due_date or build_revrec_schedule 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 Guidelines4/5

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

Gives real decision guidance for the method choice: 'months' (default) vs 'days' (Stripe default), plus the useful edge case that monthly plans yield the same answer either way. It does not state when this tool should not be used or name a sibling alternative, but the purpose is narrow enough that this is not a practical gap.

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