Skip to main content
Glama

Prepare cancelling a document

prepare_cancel_invoice

Checks that an issued invoice or proforma can be cancelled and returns a summary of the cancellation for the user's confirmation: the number, type and date, the customer, the gross total, whether it was sent or paid, its KSeF status and the effect of cancelling (cancelling can't be undone; the number of an invoice stays taken and is not reused), with a one-time confirmation token valid for 10 minutes. No data of the company or its documents is changed.

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>"
    },
    "name": "prepare_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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Adds real value beyond the annotations: cancellation is irreversible, the invoice number stays taken and is not reused, and the token expires in 10 minutes. It also clarifies that despite readOnlyHint=false, no company or document data is modified (the token is the only state created) – this is a reconciliation of the annotation rather than a contradiction, since a write-free check can still produce server-side state.

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 purpose and the return summary, and the parenthetical about number reuse and irreversibility earns its place. It is a single dense run-on sentence with a long enumerated list, which is slightly harder to parse than it needs to be.

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, but the description effectively documents the return payload (summary fields plus confirmation token) and its lifetime. For a two-parameter, non-destructive pre-check, nothing an agent needs in order to call it and interpret the result is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and both parameters are documented in-schema, including provenance hints (list_companies, list_invoices). The description adds no syntax, format, or constraint detail beyond the schema, so the baseline 3 applies.

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?

States a specific verb ('checks ... can be cancelled') and resource ('issued invoice or proforma') plus what it returns: a cancellation summary with number, type, date, customer, gross total, sent/paid flags, KSeF status and cancellation effect. The 'prepare_' prefix and the returned confirmation token make the two-step flow with cancel_invoice inferable, but the description never names that sibling explicitly.

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?

Clear usage context: call this to verify cancellability and produce a summary 'for the user's confirmation' before the actual cancellation. The presence of a one-time token implies a required follow-up step, though the description does not state which tool consumes the token or what to do if the check fails.

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