Skip to main content
Glama

Write off document

write_off_document

Write off the unpaid rest of a sales invoice that will not be paid (bad debt), as the app's Write off on the invoice does: the outstanding amount goes to the write-off account, the VAT on it is reversed, and the invoice is locked. The write-off is always dated today, so its VAT reversal lands in the current open period; there is no date to choose. Without confirm true it changes nothing and answers reason confirm-required naming the amount, the account and the date; ask the user, then call again with confirm true. Refuses a quote or other non-invoice (not-an-invoice), a void invoice, one already written off (unchanged), one marked settled, one with nothing outstanding, one with a bank payment waiting for the owner's confirm (payment-pending), an invoice dated after today (invalid-date), and books locked through today (locked-period). A missing or another business's id is not-found.

Input Schema

NameRequiredDescriptionDefault
idYesThe sales invoice to write off, from list_invoices or get_document.
confirmNoSend true only after the user has agreed to the write-off the refusal described.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior3/5

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

Annotations only give readOnlyHint=false and destructiveHint=false, so the description carries useful extra context: the money movement, the VAT reversal, the invoice lock, the fixed today-date, and the confirm gate. However destructiveHint=false sits uneasily with an irreversible lock-and-reclassify operation, and the description never flags that the action is not undoable, so the safety profile is not fully resolved.

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?

Information is front-loaded: what it does, then the date/period caveat, then the confirm gate, then refusals. It is long and the refusal enumeration is dense inline prose, but every clause carries operational information rather than padding.

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?

No output schema exists, yet the description conveys what comes back (reason confirm-required with amount/account/date, and the named refusal codes) plus the full failure surface. Nothing material an agent needs to call this correctly 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 the baseline is 3, but the description adds real meaning: it explains that confirm is a two-step gate that changes nothing without it and returns a reason naming amount, account and date, and it identifies where the id comes from (list_invoices or get_document).

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 resource ('Write off the unpaid rest of a sales invoice... bad debt') and spells out the accounting effect: outstanding amount to write-off account, VAT reversed, invoice locked. This is clearly distinguishable from siblings such as void_document and record_document_payment.

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 when-to-use (invoice that will not be paid) plus an exhaustive when-not-to-use list keyed to refusal codes (quote, void invoice, already written off, settled, nothing outstanding, payment-pending, invalid-date, locked-period). The confirm-then-retry flow is stated as a required interaction pattern.

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