Skip to main content
Glama

Proration

proration
Read-onlyIdempotent

Compute a prorated charge or refund for a partial billing period. PREMIUM (license).

Typical input {"amount_per_period": 90, "days_used": 10, "days_in_period": 30} returns {"days_used": 10, "days_in_period": 30, "prorated_charge": 30.0, "prorated_refund": 60.0, "answer": 30.0}.

Use when a plan starts, ends, or changes mid-period. Not for splitting a full amount into scheduled payments (installment_plan). Errors: on invalid, missing, or malformed input this tool never raises a protocol error — it returns {"error": ""} (for example {"error": "need amount > 0 and 0 <= days_used <= days_in_period"}). Every call is read-only and idempotent, so after correcting the input it is always safe to retry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
days_usedYesDays of the period consumed; 0 to days_in_period.
refund_modeNoIf true, "answer" is the refund amount instead of the charge. Default false.
days_in_periodNoLength of the billing period in days; at least 1. Default 30.
amount_per_periodYesFull-period price; must be greater than 0.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

TDQS

A4.8/5.0
Behavior5/5

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

The description clearly states that the tool never raises protocol errors on invalid input, instead returning an descriptive error object. It confirms idempotency and safety for retries after corrections. These behaviors go beyond the annotations (readOnlyHint, idempotentHint, destructiveHint) by explaining the exact error-handling mechanism and providing actionable advice for the agent.

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?

The description is well-structured with a purpose statement, example, usage guidance, error behavior, and safety note. It is comprehensive yet relatively concise. Minor improvement: the example JSON formatting uses newlines which helps readability, but the error example could be shorter without losing clarity.

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?

Given the tool's moderate complexity (4 parameters, 2 required), full schema coverage, output schema availability, and annotations covering read-only and idempotent nature, the description is complete. It covers purpose, usage boundaries, error model, retry safety, and provides a concrete example. No notable gaps remain.

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?

The schema already provides 100% coverage with clear descriptions and defaults. The description adds value by showing a concrete example (`90, 10, 30 → 30.0`), which illustrates the relationship between parameters. It also clarifies that `amount_per_period` must be greater than 0, which is already in schema but reinforced. However, the description does not explain `refund_mode` in detail beyond the example context.

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?

The description clearly states the tool's purpose: 'Compute a prorated charge or refund for a partial billing period.' It provides a concrete example and explicitly distinguishes itself from the sibling tool `installment_plan`, which is used for splitting full amounts into scheduled payments.

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?

The description includes explicit guidance on when to use ('when a plan starts, ends, or changes mid-period') and when not to use ('Not for splitting a full amount into scheduled payments (installment_plan)'). It also names the sibling tool `installment_plan` as the alternative, providing clear usage boundaries.

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.

TDQS

A4.6/5.0
Disambiguation5/5

Each tool serves a distinct pricing/financial calculation: gross-up from net (charge_to_net), stacking discounts (discount_stack), installment schedules (installment_plan), invoice totals (invoice_total), processor fee breakdown (processor_fees), and proration (proration). Even closely related tools like charge_to_net and processor_fees are clearly inverses, with descriptions explicitly noting when to use one versus the other.

Naming Consistency4/5

All six tool names use a clear noun or noun phrase with underscores, following a consistent pattern (e.g., charge_to_net, discount_stack, installment_plan). The only minor deviation is that some names are verb-first (charge_to_net) while others are noun-first (processor_fees), but the pattern is predictable and readable.

Tool Count5/5

With six tools, the set is well-scoped for a merchant/pricing MCP server. Each tool covers a common financial calculation need (fees, discounts, installments, invoicing, proration) without bloat. The count is lean yet sufficient for its domain.

Completeness4/5

The tool set covers core merchant calculations: gross-up, fee breakdown, discount stacking, installment plans, invoice totaling, and proration. Minor gaps include missing currency conversion or tax jurisdiction handling, but for a focused pricing/fee calculator the coverage is solid.

Resources