Skip to main content
Glama

Allocate credit note

allocate_credit_note

Set a credit note against the sales invoice it credits, or a debit note against the bill it reduces, as the app's link on the note does. The invoice's outstanding amount goes down by the amount set; no payment is recorded and no ledger entry is added. Without amount it sets as much as both allow: the rest of the note, or the invoice's outstanding amount if that is less. Without confirm true it changes nothing and answers reason confirm-required naming both documents and the amount; ask the user, then call again with confirm true. Refuses a pair that is not credit note to sales invoice or debit note to bill (not-a-pair), a document in the bin (deleted), a void one, two currencies (currency-mismatch), a pair already linked (unchanged), an invoice with nothing outstanding, an amount of zero or less (invalid-amount), and more than is left on the note or outstanding on the invoice (over-allocated). A missing or another business's id is not-found.

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": {
      "invoiceid": "<invoiceid>",
      "noteid": "<noteid>"
    },
    "name": "allocate_credit_note"
  }
}

Input Schema

NameRequiredDescriptionDefault
amountNoHow much of the note to set against it. Omit it to use as much as both documents allow.
noteidYesThe credit note or debit note to set against it.
confirmNoSend true only after the user has agreed to the allocation the refusal described.
invoiceidYesThe sales invoice (for a credit note) or bill (for a debit note) to reduce, from list_invoices or get_document.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only say non-read-only and non-destructive; the description supplies everything else an agent needs: the outstanding amount is reduced, no payment or ledger entry is created, a dry-run gate via confirm with a machine-readable reason (confirm-required) naming both documents and the amount, and a full refusal taxonomy with reason codes (not-a-pair, deleted, unchanged, currency-mismatch, invalid-amount, over-allocated, not-found).

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 effect, then defaulting behavior, then the confirm gate, then refusals – a sensible progression with no filler. Sentences are long and comma-chained, especially the refusal sentence, which costs a bit of readability but not content.

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 4-parameter mutation tool with no output schema, the description covers effect, side-effect absence, defaults, the confirmation protocol, and every failure mode including reason codes and the not-found case for cross-business ids. There is no obvious missing information an agent would need to call it correctly.

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 behavioral meaning beyond the schema: amount omitted defaults to the minimum of remaining note and outstanding invoice, and confirm gates the mutation rather than just being a boolean flag. Invoice/note id semantics are largely left to the schema.

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?

States a specific verb and both resource shapes ('Set a credit note against the sales invoice it credits, or a debit note against the bill it reduces') and immediately distinguishes itself from payment-recording and ledger-writing tools by saying no payment is recorded and no ledger entry is added.

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

Usage Guidelines4/5

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

Gives a clear when-to-use (matching a note to the document it credits) plus an explicit two-step workflow: without confirm nothing changes, ask the user, then call again with confirm true. It also enumerates rejection conditions that tell the agent when the call is inapplicable. It does not name sibling alternatives such as record_document_payment or write_off_document, which is the only gap.

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