Skip to main content
Glama
ucetka-mcp

ucetka-mcp

Cancel issued invoice

cancel_invoice
DestructiveIdempotent

Cancel only issued invoices never delivered to the customer; they remain in the ledger and number series but no longer count toward income, VAT, or overviews.

Instructions

Cancel (storno) an issued invoice: it stays in the ledger and in the number series, but no longer counts towards income, VAT or overviews. Use ONLY when the user explicitly cancels it and it was never delivered to the customer; if it was already delivered, do not cancel — issue a credit note with issue_credit_note.

Destructive: overwrites the invoice's status (also a paid one) in ~/.ucetka/invoices/.json; no tool restores it. Repeating sets the same state (a new reason replaces the old). The PDF file is kept. Re-runs the issued-invoice import afterwards. Fails for unknown numbers. Confirm with the user first.

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": {
      "number": "<number>",
      "reason": "<reason>"
    },
    "name": "cancel_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
numberYesNumber of the issued invoice to cancel, e.g. '2610001'.
reasonYesWhy it is cancelled, stored in the ledger, e.g. 'chybná, nahrazena fakturou 2609001'.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / number / description
      Previous value: -"Číslo vydané faktury."New value: +"Number of the issued invoice to cancel, e.g. '2610001'."
    • addedInput schema / properties / number / pattern
      Added value: +"^[A-Za-z0-9_-]{1,20}$"
    • changedInput schema / properties / reason / description
      Previous value: -"Důvod, např. 'chybná, nahrazena fakturou 2609001'."New value: +"Why it is cancelled, stored in the ledger, e.g. 'chybná, nahrazena fakturou 2609001'."
  2. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations: it says the JSON file at ~/.ucetka/invoices/<number>.json is overwritten including a paid invoice's status, that no tool restores it, that the PDF is retained, that a re-import runs afterwards, and that unknown numbers fail. The repeat-call semantics match idempotentHint, so annotations and description are consistent and mutually reinforcing.

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

Conciseness5/5

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

Two dense paragraphs: purpose and conditions first, side effects and failure modes second. Every sentence carries information an agent would otherwise have to guess, and there is no restating of the tool name or 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 mutation with an output schema and full annotation coverage, this covers everything an agent needs: preconditions, irreversibility, file location, retained artifacts, repeat behavior, and failure cases. Nothing material is missing or left implicit.

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: the stored reason is replaced on a repeat call, which tells the agent how the `reason` parameter behaves over time. The `number` parameter is not elaborated beyond "unknown numbers fail," which the schema already frames.

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 ("Cancel (storno) an issued invoice") and immediately clarifies what cancelling does not do (invoice stays in ledger and number series). That conceptual scoping alone separates it from issue_credit_note, which it names explicitly.

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 an explicit use condition ("Use ONLY when the user explicitly cancels it"), a hard exclusion ("never delivered to the customer"), a named alternative for the excluded case (issue_credit_note), and a process requirement ("Confirm with the user first"). Nothing about when to reach for this tool is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.