Skip to main content
Glama

previewCreditNote

Read-only

Compute a credit note for an issued or paid invoice without creating it: it stores nothing and emails no one. Call it before createCreditNote with the same invoiceRef and lines. Returns the credit note with its lines and totals, and splits totalAmount into prePaymentAmount, the part that lowers what the customer still owes on the invoice, and postPaymentAmount, the part the customer already paid, which createCreditNote must give back. Get creditNote.invoiceRef from getInvoices. Each line credits one invoice item: invoiceItemRef is the id of one of that invoice's items (from getInvoiceItems with invoiceRef), with either quantity, a whole number of units up to the item's quantity, or amount, a share of the item's total before discount in major units of the invoice currency, with exclusive tax added on top. Never pass both, and credit each item at most once. Never invent UUIDs; only use values from prior tool responses.

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": {
      "creditNote": "<creditNote>"
    },
    "name": "previewCreditNote"
  }
}

Input Schema

NameRequiredDescriptionDefault
creditNoteYesCredit note to preview.

Output Schema

NameRequiredDescriptionDefault
creditNoteYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, and the description reinforces this with 'it stores nothing and emails no one' — concrete side-effect language. It goes further by explaining how totalAmount splits into prePaymentAmount (reduces outstanding balance) and postPaymentAmount (already paid, must be refunded), which no annotation conveys. It stops short of mentioning error or validation behavior on invalid inputs.

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 compute-only guarantee and the follow-up createCreditNote call, which is the highest-value information. It is a single dense paragraph with several clauses chained by semicolons, so the key mutual-exclusivity constraint sits mid-block rather than being isolated for scanning.

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?

Although an output schema exists and return values would not need spelling out, the description still explains the non-obvious prePaymentAmount/postPaymentAmount split that an agent must reason about before calling createCreditNote. Combined with prerequisite sourcing and per-line rules for a nested-object tool, nothing essential for a correct call is missing.

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 baseline is 3, but the description adds rules absent from the schema: quantity and amount are mutually exclusive ('Never pass both'), each item may be credited at most once, quantity is a whole number up to the item's quantity, and amount is a pre-discount share with exclusive tax added on top. It also constrains sourcing of UUIDs to prior tool responses. The 'refunds' and 'creditAmount' fields are left unaddressed, keeping this below a 5.

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 precise verb+resource+scope: 'Compute a credit note for an issued or paid invoice without creating it,' which immediately separates it from createCreditNote. The dry-run nature is stated in the first clause, so an agent can classify the tool without reading further.

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?

Explicitly instructs 'Call it before createCreditNote with the same invoiceRef and lines,' naming the sibling and the condition that pairs them. It also routes prerequisite lookups to getInvoices for invoiceRef and getInvoiceItems for item ids, covering the full call sequence rather than just the call itself.

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