Skip to main content
Glama

Apply to invoice

o2c_apply_payment

Apply some or all of a payment to an invoice. Bounded on both sides: never more than the payment has left, never more than the invoice still owes. Both refusals name the actual numbers, so the right next step is obvious.

Overpayment is real and stays as unapplied cash against the customer. Do not spread it across invoices the customer did not name. Effects: application recorded; invoice.status -> paid when fully settled.

Input Schema

NameRequiredDescriptionDefault
amountNoHow much to apply. Omit to apply the smaller of what is left on each side. In cents (integer minor units) — 1250 means $12.50.
invoice_idYesThe invoice it settles. An existing invoice id.
payment_idYesThe payment. An existing payment id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare the mutation and non-idempotent profile, so the description's added value is the state effects: overpayment persists as unapplied cash and invoice.status flips to paid when fully settled. It also discloses the failure mode (refusals naming actual numbers on both the payment and invoice bound), which is behavior an agent cannot read from the annotations.

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 core action, then bounds, then overpayment policy, then effects — a sensible order with no filler sentences. The aside 'so the right next step is obvious' is mild editorializing that could be cut.

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 a 3-parameter mutation with no output schema, the description covers the action, the validation envelope, the overpayment residue, and the resulting state change, which is close to everything an agent needs. It stops short of stating permissions, idempotency/retry behavior (relevant since idempotentHint is false), or what an application result contains.

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 100%, so the amount/invoice_id/payment_id semantics, including the cents convention and the omit-to-take-the-smaller default, are already documented in structured fields. The description's only addition is the two-sided bound on amount, which is useful but largely behavioral rather than parameter-level, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: apply a payment (some or all) to an invoice. It is immediately distinguishable from a generic payment tool, though it never names its closest siblings (o2c_record_payment, o2c_apply_credit, o2c_unapplied_cash), so the agent must infer the boundary.

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

Usage Guidelines3/5

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

It gives one real usage constraint — do not spread overpayment across invoices the customer did not name — which is a usable when-not rule. But it never says when to reach for this versus recording a payment or applying a credit note, and prerequisites (payment must exist, be unapplied) are only implied by the schema.

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.