Skip to main content
Glama

createCreditNote

Destructive

Issue a credit note against an issued or paid invoice, to reduce or give back what the customer was billed. Returns the created credit note. It is issued at once: it gets its number, the customer is emailed it, and only its internal note can change afterwards. The part of the total the customer has not paid yet (prePaymentAmount) lowers the invoice's amount due, and the invoice becomes paid when nothing is left to pay. The part already paid (postPaymentAmount) must be given back in full: refunds, creditAmount and outOfBandAmount together must add up to exactly postPaymentAmount, so first compute it with previewCreditNote. refunds give money back on payments of the invoice: { transactionRef, amount }, with transactionRef from the invoice's payments, sends that amount back through the payment gateway the customer paid with, while { id } records a refund already made on a payment. Refunds cannot be used on an invoice billed in an alt currency. creditAmount adds money to the customer's balance, which pays their next invoices. outOfBandAmount records money given back outside Spacebring, such as by bank transfer. A draft invoice, a voided invoice and an invoice with a payment in progress cannot be credited. 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. The route is not idempotent: after a failure or timeout, check the result with the list tool before calling again, or a second record is created. 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": "createCreditNote"
  }
}

Input Schema

NameRequiredDescriptionDefault
creditNoteYesCredit note to create.

Output Schema

NameRequiredDescriptionDefault
creditNoteYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the destructiveHint=false/true annotations, it discloses that issuing is immediate and effectively irreversible (number assigned, customer emailed, only internalNote editable afterwards), the exact conservation rule that refunds + creditAmount + outOfBandAmount must equal postPaymentAmount, that refunds traverse the original payment gateway, and that the route is not idempotent. Nothing here contradicts 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?

The most decision-critical facts (what it does, that it is immediate and irreversible, and the previewCreditNote prerequisite) are front-loaded, and almost every sentence carries substantive rules. It is still a dense wall of prose for a nested-object tool, and a short bulleted structure for the three give-back mechanisms would have been easier to parse.

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?

For a destructive, non-idempotent creation tool with nested objects, the description covers effect, prerequisites, sibling tools for id lookup and preview, failure recovery, and constraints. Return values need not be explained since an output schema exists and the description states it returns the created credit note.

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

Parameters5/5

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

Schema coverage is 100%, so a 3 would be the floor, but the description genuinely adds meaning: it distinguishes refunds `transactionRef` (gateway refund on a payment) from `id` (records an already-made refund), explains that creditAmount feeds the customer balance used on future invoices, and that outOfBandAmount is money returned outside the platform. For lines it clarifies the quantity-vs-amount exclusivity, the pre-discount basis with exclusive tax added on top, and the at-most-once-per-item rule.

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 opening sentence gives a specific verb and resource ("Issue a credit note against an issued or paid invoice") plus the business effect (reduce or give back what was billed). It is immediately distinguishable from siblings such as previewCreditNote, updateCreditNote and voidCreditNote.

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?

Explicit routing is given: compute postPaymentAmount with previewCreditNote first, get invoiceRef from getInvoices, and get item ids from getInvoiceItems. It also states when the tool cannot be used (draft invoice, voided invoice, payment in progress, alt-currency invoices for refunds) and how to recover from a non-idempotent failure via the list tool.

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