Skip to main content
Glama

Rectify invoice

rectify_invoice

Create a rectifying invoice (facture rectificative) for a Sent or Paid invoice: a NEW Draft invoice pre-filled from the original (same client, copied line items unless overridden) and legally linked to it. The original is marked Rectified only when the rectificative is issued. Call with confirm:true to create; without it, returns a preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsNoReplacement line items. Omit to copy the original's items.
notesNoNotes printed on the rectificative (max 2000 characters). Omit to copy the original's notes.
confirmNoMust be true to create the rectificative. Omit/false to preview.
due_dateNoDue date, YYYY-MM-DD. Defaults from the original's payment terms.
invoice_idYesThe original invoice to rectify.
issue_dateNoIssue date, YYYY-MM-DD. Defaults to today.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoInvoice UUID.
noteNoNext-step guidance, present on preview responses.
typeNoDocument type: invoice, credit_note, provision or quote.
notesNoNotes printed on the document.
statusNoDocument status: Draft, Sent, Paid, Overdue, Cancelled, Rectified, Accepted, Rejected or Expired.
paid_atNoPayment timestamp (ISO 8601), null while unpaid.
previewNoTrue when the call was a preview (confirm omitted or false): nothing was changed.
sent_atNoIssue timestamp (ISO 8601), null while Draft.
currencyNoISO 4217 currency code (EUR, USD, GBP or CHF).
due_dateNoDue date, YYYY-MM-DD.
originalNoInvoice that would be rectified (preview only).
matter_idNoMatter (dossier) UUID, null when unassigned.
net_totalNoTotal excl. VAT, in the document currency.
tax_totalNoVAT amount, in the document currency.
amount_dueNoGross total minus applied provisions, null when not computed.
company_idNoClient company UUID.
created_atNoCreation timestamp (ISO 8601).
issue_dateNoIssue date, YYYY-MM-DD.
updated_atNoLast update timestamp (ISO 8601).
gross_totalNoTotal incl. VAT, in the document currency.
valid_untilNoQuote validity limit, YYYY-MM-DD; null for other types.
vat_scenarioNoFiscal scenario frozen at creation (e.g. domestic, eu_b2b_reverse_charge).
would_createNoOutline of the rectificative that would be created (preview only).
payment_termsNoPayment terms: Net-15, Net-30, Net-60, Net-90 or Due on Receipt.
advances_totalNoSum of provisions applied, in the document currency.
created_sourceNoOrigin of the document: manual (app) or mcp (agent).
credit_note_idNoCredit note UUID that cancelled this invoice.
internal_notesNoPrivate notes, never printed.
invoice_numberNoHuman-readable document number.
invopop_statusNoFiscal certification status from the provider, null before issuance.
source_quote_idNoQuote UUID this invoice was converted from.
delivery_channelNoDelivery channel: Email, e-Invoice or Manual.
replaces_invoice_idNoOriginal invoice UUID when this is a rectificative.
replaced_by_invoice_idNoRectificative UUID when this invoice was rectified.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • changedInput schema / properties / due_date / description
      Previous value: -"Defaults from the original's payment terms."New value: +"Due date, YYYY-MM-DD. Defaults from the original's payment terms."
    • changedInput schema / properties / issue_date / description
      Previous value: -"Defaults to today."New value: +"Issue date, YYYY-MM-DD. Defaults to today."
    • addedInput schema / properties / items / items / properties / description / description
      Added value: +"Line text printed on the invoice (1-500 characters)."
    • changedInput schema / properties / items / items / properties / line_type / description
      Previous value: -"Defaults to 'item'."New value: +"Line kind: 'item' (billable, needs quantity and unit_price), 'section' (visual header) or 'description' (text-only sub-line). Defaults to 'item'."
    • changedInput schema / properties / items / items / properties / quantity / description
      Previous value: -"Required for 'item' lines."New value: +"Quantity. Required for 'item' lines."
    • changedInput schema / properties / items / items / properties / tax_rate / description
      Previous value: -"OMIT — do NOT ask the user for a VAT rate. VAT is determined server-side by strict fiscal rules. Only set when the user explicitly states a rate."New value: +"OMIT - do NOT ask the user for a VAT rate. VAT is determined server-side by strict fiscal rules. Only set when the user explicitly states a rate, as a percent (0-100)."
    • changedInput schema / properties / items / items / properties / unit_price / description
      Previous value: -"Required for 'item' lines."New value: +"Unit price excl. VAT, in the invoice currency. Required for 'item' lines."
    • addedInput schema / properties / notes / description
      Added value: +"Notes printed on the rectificative (max 2000 characters). Omit to copy the original's notes."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "advances_total": {
      +      "description": "Sum of provisions applied, in the document currency.",
      +      "type": "number"
      +    },
      +    "amount_due": {
      +      "anyOf": [
      +        {
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Gross total minus applied provisions, null when not computed."
      +    },
      +    "company_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Client company UUID."
      +    },
      +    "created_at": {
      +      "description": "Creation timestamp (ISO 8601).",
      +      "type": "string"
      +    },
      +    "created_source": {
      +      "description": "Origin of the document: manual (app) or mcp (agent).",
      +      "type": "string"
      +    },
      +    "credit_note_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Credit note UUID that cancelled this invoice."
      +    },
      +    "currency": {
      +      "description": "ISO 4217 currency code (EUR, USD, GBP or CHF).",
      +      "type": "string"
      +    },
      +    "delivery_channel": {
      +      "description": "Delivery channel: Email, e-Invoice or Manual.",
      +      "type": "string"
      +    },
      +    "due_date": {
      +      "description": "Due date, YYYY-MM-DD.",
      +      "type": "string"
      +    },
      +    "gross_total": {
      +      "description": "Total incl. VAT, in the document currency.",
      +      "type": "number"
      +    },
      +    "id": {
      +      "description": "Invoice UUID.",
      +      "type": "string"
      +    },
      +    "internal_notes": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Private notes, never printed."
      +    },
      +    "invoice_number": {
      +      "description": "Human-readable document number.",
      +      "type": "string"
      +    },
      +    "invopop_status": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Fiscal certification status from the provider, null before issuance."
      +    },
      +    "issue_date": {
      +      "description": "Issue date, YYYY-MM-DD.",
      +      "type": "string"
      +    },
      +    "matter_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Matter (dossier) UUID, null when unassigned."
      +    },
      +    "net_total": {
      +      "description": "Total excl. VAT, in the document currency.",
      +      "type": "number"
      +    },
      +    "note": {
      +      "description": "Next-step guidance, present on preview responses.",
      +      "type": "string"
      +    },
      +    "notes": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Notes printed on the document."
      +    },
      +    "original": {
      +      "additionalProperties": false,
      +      "description": "Invoice that would be rectified (preview only).",
      +      "properties": {
      +        "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"
      +      ],
      +      "type": "object"
      +    },
      +    "paid_at": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Payment timestamp (ISO 8601), null while unpaid."
      +    },
      +    "payment_terms": {
      +      "description": "Payment terms: Net-15, Net-30, Net-60, Net-90 or Due on Receipt.",
      +      "type": "string"
      +    },
      +    "preview": {
      +      "description": "True when the call was a preview (confirm omitted or false): nothing was changed.",
      +      "type": "boolean"
      +    },
      +    "replaced_by_invoice_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Rectificative UUID when this invoice was rectified."
      +    },
      +    "replaces_invoice_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Original invoice UUID when this is a rectificative."
      +    },
      +    "sent_at": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Issue timestamp (ISO 8601), null while Draft."
      +    },
      +    "source_quote_id": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Quote UUID this invoice was converted from."
      +    },
      +    "status": {
      +      "description": "Document status: Draft, Sent, Paid, Overdue, Cancelled, Rectified, Accepted, Rejected or Expired.",
      +      "type": "string"
      +    },
      +    "tax_total": {
      +      "description": "VAT amount, in the document currency.",
      +      "type": "number"
      +    },
      +    "type": {
      +      "description": "Document type: invoice, credit_note, provision or quote.",
      +      "type": "string"
      +    },
      +    "updated_at": {
      +      "description": "Last update timestamp (ISO 8601).",
      +      "type": "string"
      +    },
      +    "valid_until": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Quote validity limit, YYYY-MM-DD; null for other types."
      +    },
      +    "vat_scenario": {
      +      "description": "Fiscal scenario frozen at creation (e.g. domestic, eu_b2b_reverse_charge).",
      +      "type": "string"
      +    },
      +    "would_create": {
      +      "additionalProperties": false,
      +      "description": "Outline of the rectificative that would be created (preview only).",
      +      "properties": {
      +        "company_id": {
      +          "description": "Client company UUID carried over from the original.",
      +          "type": "string"
      +        },
      +        "items_count": {
      +          "description": "Number of line items the rectificative would carry.",
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "items_source": {
      +          "description": "Where the items come from: 'override' or 'copied from original'.",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "company_id",
      +        "items_count",
      +        "items_source"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

The description discloses the tool's mutation behavior (creates a new invoice, marks the original as Rectified only upon confirmation), the preview-vs-create distinction via the confirm parameter, and the server-side VAT determination. This goes beyond the sparse annotations (readOnlyHint false, destructiveHint false) to give a concrete picture of what happens when the tool is called.

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?

The description is slightly long but each sentence carries essential operational or fiscal information. It front-loads the primary purpose and confirm semantics, then details parameters. No waste, but the repeated emphasis on VAT rules and defaults could be trimmed without losing critical guidance.

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?

Given that an output schema exists (per context signals), the description need not detail return values. It covers invocation, parameters, defaults, and side effects, leaving no significant gaps for an agent to call the tool correctly. Minor omission: it doesn't explicitly state the output format of the preview, but this is acceptable since the output schema is expected to cover it.

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?

Every parameter is described with meaningful details beyond the schema. For example, the tax_rate parameter explicitly warns 'OMIT - do NOT ask the user for a VAT rate' and explains server-side rules; line_type is explained with billable/visual/text distinctions; items and notes have default-copy behavior. This fully compensates for any schema gaps.

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 tool creates a rectifying invoice for a Sent or Paid invoice, distinguishes it from other invoice operations by specifying it creates a NEW Draft pre-filled from the original, and explains the legal linkage and marking of the original. This is a specific verb+resource combination that leaves no ambiguity about what the tool does.

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?

The description explicitly explains when to use the tool (for rectifying sent/paid invoices) and the critical confirm behavior: 'Call with confirm:true to create; without it, returns a preview.' It also clarifies the effect on the original invoice, giving the agent clear guidance on invocation and expected consequences.

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.