Skip to main content
Glama

Octobooks

Pay, write off, void or copy an invoice

invoice_action
Destructive

What is done to an invoice once it is written (round 595, like Xero). invoice is an id or a number. what=payment: money received on an issued invoice (amount, left out: what is due; date YYYY-MM-DD, account = the bank or cash account it went into, reference, fee: what the bank or payment service kept, booked to bank charges while the invoice is settled by the whole amount; receipt=true mails the customer a payment receipt once it is booked); less than due leaves the rest open, more is kept as the customer's credit. An invoice in another currency than the books (a euro invoice paid into a pound account): amount is in the invoice's currency, bank_amount what arrived in the bank account's currency (left out: at the day's rate); the difference to the value the invoice was booked at is posted as a realised currency gain or loss. what=allocate: set customer credit against an issued invoice (source = a credit note number, or receipt: of an overpayment, as the list of credits names them; amount optional). what=refund: pay customer credit back (source, amount, date, account; credit in another currency: bank_amount what left the bank in its currency, the difference a realised gain or loss). Payment, allocation and refund are proposed as one pending action each and are booked and settled on release, as the owner's switches say. what=void: cancel an issued invoice the way the law allows: a credit note for all of it that is not credited yet (the Stornorechnung on a German company), dated date, proposed for issue; the invoice keeps its number. An invoice with money on it needs payments=remove (the payments come off it, then it is voided) or payments=keep (what was paid stays the customer's credit); without it nothing is done. what=write_off: write off what is still due as a bad debt (amount optional, date, account optional: the bad debts account, reason; relief=false leaves the VAT as it is): a UK company claims the VAT bad debt relief in box 4, by default dated on the day HMRC gives it from (six months after the later of the due date and the date of supply, VAT Notice 700/18), so it falls in that return; relief_date (YYYY-MM-DD) dates the claim otherwise (earlier is allowed and said once); a German or Austrian company corrects the Umsatzsteuer (section 17 UStG, section 16 UStG 1994); proposed like a payment, the invoice reads Written off on release. what=remove_payment with source = a payment's settlement_id and reason: takes a payment, credit or write off back off the invoice, proposed; on release as Remove on its page (round 633). what=copy: a new draft with the same customer and lines. what=correct (round 793, Lexware's Berichtigen): cancel and reissue in one step: the void's credit note (Stornorechnung) dated date (left out: the invoice's own date in Germany and Austria while that month is open and no return is on record for it, else today; today in the UK) plus a corrected copy as a draft (copy_id; an invoice credited in part already: what is left of it) to change as a draft and issue; the answer names the invoice's state (not_sent, sent, part_paid, paid); what was paid stays the customer's credit. what=state: where the invoice stands for a correction, nothing changed. what=delete: a draft goes (one this connection made; one waiting for release is withdrawn before); an issued invoice is not deleted. what=undo (round 830): an invoice issued by mistake, unpaid, not sent yet and in no VAT return on record, goes back to a draft: a credit note cancels it (its number stays given) and draft copy_id holds its lines. what=void on a credit note: its entry is reversed (date = the credit note's own date unless given), it reads Voided, and what it was set against is due again. what=attach with source = a document_id of an uploaded file: the file is kept with the issued invoice under Stored files. idempotency_key makes a request safe to repeat.

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": {
      "what": "<what>"
    },
    "name": "invoice_action"
  }
}

Input Schema

NameRequiredDescriptionDefault
feeNo
dateNo
whatYes
amountNo
reasonNo
reliefNo
sourceNo
accountNo
companyNo
invoiceNo
receiptNo
paymentsNo
referenceNo
bank_amountNo
relief_dateNo
idempotency_keyNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior5/5

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

Beyond annotations, it discloses that several actions are proposed as pending actions and booked on release, describes side effects such as credit notes, customer credits, realised FX gains or losses, and VAT return impacts, and notes that idempotency_key makes a request safe to repeat. This is unusually rich behavioral disclosure for a destructive write tool.

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

Conciseness2/5

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

The content is dense and mostly non-redundant, but it is delivered as a single run-on paragraph with nested parentheses and no headings, bullets, or clear per-action structure. For a 16-parameter, multi-mode tool, that makes the definition much harder to scan than necessary.

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?

Given the high complexity, destructive annotations, and existing output schema, the description covers nearly all behavioral and legal context an agent needs to choose and invoke the modes correctly. Gaps remain around the `company` parameter and the mention of `copy_id` without a corresponding input-schema property, but overall it is contextually rich.

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?

With 0% schema description coverage across 16 parameters, the description supplies meaning for most of them: invoice, what, amount, date, account, reference, fee, receipt, bank_amount, source, payments, reason, relief, relief_date, and idempotency_key. It leaves `company` unexplained and embeds parameter meaning in prose rather than a systematic list, so it is not fully complete.

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 identifies a multi-action tool for post-issue invoice operations and enumerates the supported `what` modes, including payment, allocate, refund, void, write_off, correct, state, delete, undo, and attach. It does not explicitly differentiate itself from siblings such as invoice_issue or release, though 'once it is written' implies post-issue scope.

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?

It gives detailed preconditions for each mode: void requires payments=remove or payments=keep when money is on the invoice, undo is limited to unpaid/unsent invoices not in a VAT return, and write_off explains jurisdiction-specific VAT treatment. It does not name sibling tools as alternatives, but the mode-specific guidance is strong.

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