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 line stub matched to it that is not yet linked (payment-pending: blockingpayments lists each line's id, date, amount and narration; name those lines to the user, never guess one), an invoice dated after today (invalid-date), and books locked through today (locked-period). 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": {
      "id": "<id>"
    },
    "name": "write_off_document"
  }
}

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.7/5.0
Behavior5/5

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

Annotations only state readOnlyHint=false and destructiveHint=false; the description adds substantially beyond that: the write-off is always dated today so the VAT reversal lands in the current open period, the invoice is locked, and the call is dry-run unless confirm true. It also enumerates the terminal states (void, already written off, settled, nothing outstanding, future-dated, locked period, foreign id) with their reason codes, which no annotation conveys.

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-loads purpose and effects, then the confirm protocol, then refusals in a logical order. The refusal catalog and the parenthetical blockingpayments explanation make it a dense single paragraph, but each clause carries actionable information and nothing is merely decorative.

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?

For a multi-effect mutation with no output schema, the description covers effects, dating, period consequences, confirmation flow, and all documented refusal reasons with codes. The only gap is the shape of a successful response (what is returned on a real write-off), which the agent must infer.

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; the description goes further by explaining the exact semantics of confirm ('changes nothing and answers reason confirm-required') and the failure semantics of id (missing or another business's id yields not-found). It adds real behavioral meaning rather than restating the field docs.

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?

Names a specific verb and resource ('write off the unpaid rest of a sales invoice') and immediately scopes it to bad debt that will not be paid, plus spells out the concrete effects (write-off account, VAT reversal, invoice locked). An agent can distinguish this from void_document or record_document_payment from the text alone.

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?

Gives explicit conditions for use (unpaid invoice that will never be paid) and an explicit interactive protocol: without confirm true nothing happens, the tool returns confirm-required, and the agent must ask the user before retrying with confirm true. The enumerated refusal cases effectively tell the agent when not to call and what to do instead (e.g. surface blocking payment lines rather than guess).

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