Skip to main content
Glama

Moltline Merchant Math

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.7/5.0
Behavior4/5

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

The description discloses critical behavioral traits beyond annotations: error mode ('never raises a protocol error — it returns an error object'), retry safety ('safe to retry after correcting input'), read-only and idempotent nature (already indicated by annotations but reinforced with concrete error context). The only minor gap is not explicitly stating the output schema structure beyond the example, but given the output schema exists, this is a high score.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two compact paragraphs: the first defines purpose, provides a prototypical example, and states when to use it versus a sibling. The second covers error behavior, safety, and idempotency. Every sentence adds distinct value with no filler. The technical example is front-loaded, making the core behavior immediately clear.

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 has 4 parameters (2 required), an output schema, and a simple deterministic mathematical function, the description fully covers the input/output contract, error handling, retry behavior, and usage boundaries. An AI agent has all the information needed to invoke the tool correctly, interpret results, and recover from errors.

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 description coverage is 100%, so baseline is 3. The description adds value by providing a full example showing how parameters map to the return values ('days_used', 'days_in_period', 'prorated_charge', etc.), and by explaining the default for 'days_in_period' (30) and the effect of 'refund_mode' (controls what 'answer' represents). This enriches the schema's own descriptions meaningfully.

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 states 'Compute a prorated charge or refund for a partial billing period' with a specific verb ('compute') and clear resource ('prorated charge or refund'). It includes a concrete example and explicitly distinguishes from the sibling tool 'installment_plan' by stating 'Not for splitting a full amount into scheduled payments'. This makes the purpose highly specific and differentiated.

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 provides explicit when-to-use guidance ('Use when a plan starts, ends, or changes mid-period') and explicit when-not-to-use guidance with a named alternative ('Not for splitting a full amount into scheduled payments (installment_plan)'). It also explains error handling behavior that guides retrying after fixing input, covering both usage and error recovery.

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
Disambiguation4/5

Each tool targets a distinct calculation scenario (fees, discounts, installments, invoicing, proration). The descriptions explicitly state when to use each and when not to, reducing ambiguity. Minor overlap exists between processor_fees and charge_to_net, but the inverse relationship is clearly documented.

Naming Consistency5/5

All tool names use a consistent noun_verb pattern (e.g., charge_to_net, discount_stack, installment_plan). The naming is descriptive and follows a predictable structure, making it easy for an agent to infer tool purpose from the name alone.

Tool Count5/5

With 6 tools, the count is ideal for the domain of merchant math. Each tool covers a distinct and essential calculation type without redundancy, and the scope is neither too thin nor overly heavy.

Completeness4/5

The tools cover core merchant math operations: fee calculation, gross-up pricing, discount stacking, installment splitting, invoicing, and proration. A minor gap is the absence of a tool for compound interest or tax-only calculations, but those may be out of scope for merchant math. Overall, the surface is well-rounded for its intended domain.

Resources