Skip to main content
Glama

Cancel document

cancel_invoice
DestructiveIdempotent

Cancels the issued invoice or proforma summarised by prepare_cancel_invoice once the user has confirmed it, using its confirmation token: the document is marked cancelled and keeps its number; the number of an invoice is never reused. Cancelling can't be undone, and the customer is not notified. Refused, with the token used up, when the token expired or doesn't match, or the document changed after the preparation (e.g. marked paid or sent). A repeated call with the same token returns the same answer without cancelling again.

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": {
      "company_id": "<company_id>",
      "invoice_id": "<invoice_id>",
      "confirmation_token": "<confirmation_token>"
    },
    "name": "cancel_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
company_idYesThe id of the company, from list_companies.
invoice_idYesThe id of the issued invoice or proforma, from list_invoices.
confirmation_tokenYesThe confirmation_token of the answer of prepare_cancel_invoice for this document.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, and the description consistently adds the details an agent actually needs: the document keeps its number, numbered documents are never reused, the action is irreversible, the customer is not notified, refusals consume the token, and a repeat call with the same token returns the same answer without re-cancelling. This is behavior beyond what the annotations convey and it does not contradict them.

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 action and its prerequisite, and every sentence carries operational content (numbering, irreversibility, notification, refusal causes, repeat-call behavior). It is a dense paragraph of long clauses that would read faster split into success/refusal/idempotency lines, but there is no filler.

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 three-parameter mutation with no output schema, the description covers the success outcome (marked cancelled, number retained), the side-effect profile (irreversible, no customer notification), and all failure modes. Nothing an agent needs to call it correctly or to explain the result to a user 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 genuine meaning: the confirmation_token is derived from the prepare_cancel_invoice answer, is single-use ('used up'), and expires, which the schema description does not state. It does not extend the meaning of company_id or invoice_id beyond the schema's own pointers to list_companies and list_invoices.

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 object ('Cancels the issued invoice or proforma') and immediately scopes it to the document 'summarised by prepare_cancel_invoice', which separates it cleanly from issue_invoice, delete_invoice_draft, and other siblings. An agent can identify the operation and its target without opening the schema.

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?

Explicitly names the prerequisite flow ('once the user has confirmed it, using its confirmation token') and the originating sibling prepare_cancel_invoice, and it specifies the exact when-not conditions: token expired, token mismatch, or document changed after preparation. By restricting to 'issued invoice or proforma' it also implicitly excludes drafts, which belong to the delete-invoice-draft siblings.

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