Skip to main content
Glama

Create credit note + cancel invoice (LEGALLY BINDING)

create_credit_note
Destructive

Cancel a Sent or Paid invoice by issuing a credit note (avoir). The credit note is a legal fiscal document (fiscally certified when the original was certified) and is IMMUTABLE once created. IRREVERSIBLE. ALWAYS get the user's explicit approval before calling with confirm:true. Without confirm, returns a preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
confirmNoMust be true to create the credit note. Omit/false to preview.
invoice_idYesThe Sent/Paid invoice to cancel with a credit note.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoOutcome summary (after confirm:true).
previewNoTrue when the call was a preview (confirm omitted or false): nothing was changed.
warningNoIrreversibility warning (preview only).
credit_note_idNoUUID of the created credit note (after confirm:true).
would_cancel_with_credit_noteNoInvoice that would be cancelled by a credit note (preview only).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "credit_note_id": {
      +      "description": "UUID of the created credit note (after confirm:true).",
      +      "type": "string"
      +    },
      +    "note": {
      +      "description": "Outcome summary (after confirm:true).",
      +      "type": "string"
      +    },
      +    "preview": {
      +      "description": "True when the call was a preview (confirm omitted or false): nothing was changed.",
      +      "type": "boolean"
      +    },
      +    "warning": {
      +      "description": "Irreversibility warning (preview only).",
      +      "type": "string"
      +    },
      +    "would_cancel_with_credit_note": {
      +      "additionalProperties": false,
      +      "description": "Invoice that would be cancelled by a credit note (preview only).",
      +      "properties": {
      +        "already_has_credit_note": {
      +          "description": "True when a credit note already exists for this invoice.",
      +          "type": "boolean"
      +        },
      +        "gross_total": {
      +          "description": "Total incl. VAT, in the document currency.",
      +          "type": "number"
      +        },
      +        "id": {
      +          "description": "Document UUID.",
      +          "type": "string"
      +        },
      +        "invoice_number": {
      +          "description": "Human-readable document number.",
      +          "type": "string"
      +        },
      +        "status": {
      +          "description": "Document status: Draft, Sent, Paid, Overdue, Cancelled, Rectified, Accepted, Rejected or Expired.",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "invoice_number",
      +        "status",
      +        "gross_total",
      +        "already_has_credit_note"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A5/5.0
Behavior5/5

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

The description discloses that the credit note is IMMUTABLE and IRREVERSIBLE, and that it is LEGALLY BINDING. This goes beyond the destructiveHint annotation by adding specific legal and fiscal implications, fully informing the agent of consequences.

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?

The description is compact yet comprehensive, using clear formatting and capitalization for key warnings. Every sentence serves a purpose—purpose, legality, immutability, and confirmation requirement—without redundancy.

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?

Given the output schema exists, the description correctly avoids describing return values. It covers the operational context (preview vs. execute), eligibility (Sent/Paid), and legal consequences, making the tool fully understandable in isolation.

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

Parameters5/5

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

Both parameters are described with meaningful detail: invoice_id specifies 'Sent/Paid invoice' (eligible states), and confirm explains that true triggers creation, while false/omitted yields preview. This adds actionable semantics beyond the raw schema.

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?

The description clearly states the action: cancel a Sent or Paid invoice by issuing a credit note. It specifies the target resource (invoice) and the mechanism (credit note/avoir), leaving no ambiguity about the tool's purpose.

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 instructs that explicit user approval is required before calling with confirm:true, and explains that without confirm it returns a preview. This gives clear when-to-use and when-not-to-use guidance, including the legal caveat.

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.