Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_void_invoice

DestructiveIdempotent

Voids an issued invoice created by mistake, such as a test or duplicate, keeping the document and never reusing its number. For real operations with errors, issue a corrective instead.

Instructions

Voids an issued invoice of this company. The document is kept and its number is never reused.

  • When to use it: the invoice was issued by mistake — the operation never took place, it was a test, or it is an accidental duplicate. If the operation did take place but the invoice is wrong, issue a corrective invoice instead (POST …/{invoice_id}/corrective). The exception is a withholding that should not have been applied: it is not a cause for a corrective, so void the invoice and issue a new one without it.

  • Sent or paid: voiding an invoice that was already sent or paid requires issued_in_error: true, confirming it was issued by mistake; without it the request fails with 422 VOID_REQUIRES_ISSUED_IN_ERROR.

  • Corrected invoices: an invoice with live corrective invoices cannot be voided — it was corrected, so the operation took place; issue another corrective (422 INVOICE_HAS_LIVE_CORRECTIVES). A TOTAL corrective cannot be voided either: the invoice it rectifies would stay voided with nothing to offset it (422 TOTAL_CORRECTIVE_NOT_VOIDABLE).

  • reason: required, at least 10 characters — it is fiscal data.

  • void_date: deprecated. A date earlier than the invoice's issue date is rejected with 422 VOID_DATE_BEFORE_ISSUE_DATE.

  • VeriFactu: when it is enabled for the invoice, a cancellation record is submitted to the AEAT.

  • PDF: unchanged. The PDF of the invoice stays the one that was delivered; the void is reported by the invoice's status and the invoice.voided webhook.

  • Proformas: voiding an ACTIVE proforma is a plain status change with no fiscal effect — no corrective invoice, nothing submitted to the AEAT. The voided proforma is kept as the record of a rejected or withdrawn offer and stays listed.

Endpoint: POST /v1/companies/{company_id}/invoices/{invoice_id}/void

⚠️ Read before calling:

  • Fiscal rules, domains void, lifecycle: beel_rules_list with domain, or resource beel://guardrails/.

  • The status names, the proforma lifecycle, and which tool performs each operation. (resource: beel://guardrails/invoice-state-machine)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
company_idYesUnique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed.
invoice_idYesInvoice ID
idempotency_keyNoOptional idempotency key for this operation. Omit it and one is derived from the request itself, which makes a blind retry safe but also collapses a SECOND, deliberately identical operation into the first for 24 hours. Set it — to an order id, or anything unique per intended operation — whenever you mean to create something that may look identical to what you just created.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.9.0
    • addedInput schema / $defs / VoidInvoiceRequest / properties / issued_in_error
      Added value: +{
      +  "default": false,
      +  "description": "Confirms that the invoice was issued by mistake: the operation it describes never took\nplace, it was a test, or it is an accidental duplicate. A void is only for those cases\n(RD 1007/2023, art. 11.1); an operation that did take place is corrected with a\ncorrective invoice.\n\nRequired as `true` when the invoice has already been sent or paid — delivering or\ncollecting it suggests the operation was real, so the void has to say it was not.\nWithout it such a void fails with `422 VOID_REQUIRES_ISSUED_IN_ERROR`.\n",
      +  "type": "boolean"
      +}
    • changedInput schema / $defs / VoidInvoiceRequest / properties / void_date / description
      Previous value: -"**Deprecated and ignored.** The void is recorded with the instant it actually takes\nplace, returned as `voided_at` on the invoice. A void cannot be dated by the caller,\nso any value sent here has no effect and will be removed in a future version.\n"New value: +"**Deprecated.** The void is recorded with the instant it actually takes place,\nreturned as `voided_at` on the invoice: a void cannot be dated by the caller, and this\nvalue never changes `voided_at`. It will be removed in a future version. A date earlier\nthan the invoice's issue date is rejected with `422 VOID_DATE_BEFORE_ISSUE_DATE`.\n"
  2. Changed6 schema fields changedv0.5.0
    • removedInput schema / $defs / UUID / example
      Removed value: -"550e8400-e29b-41d4-a716-446655440000"
    • addedInput schema / $defs / VoidInvoiceRequest / additionalProperties
      Added value: +false
    • removedInput schema / $defs / VoidInvoiceRequest / properties / reason / example
      Removed value: -"Invoice issued with incorrect customer data"
    • removedInput schema / $defs / VoidInvoiceRequest / properties / void_date / example
      Removed value: -"2025-01-20"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / company_id / description
      Previous value: -"NIF (company) the operation acts on. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A NIF you do not reach answers `403`, and so does a NIF that does not exist, so the existence of a NIF in another account is never disclosed."New value: +"Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed."
  3. First observedv0.3.1

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations: it enumerates the exact 422 failure codes (VOID_REQUIRES_ISSUED_IN_ERROR, INVOICE_HAS_LIVE_CORRECTIVES, TOTAL_CORRECTIVE_NOT_VOIDABLE, VOID_DATE_BEFORE_ISSUE_DATE), discloses VeriFactu submission to the AEAT, notes the PDF is unchanged and the void is reported via status and the invoice.voided webhook, and describes proforma behavior. This is rich behavioral context that annotations (destructive/idempotent/openWorld) alone do not carry.

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 verb and outcome in the first sentence, then organized into labeled bullets (when to use, sent/paid, corrected invoices, reason, void_date, VeriFactu, PDF, proformas) plus a pre-call pointer. It is long, but the length is justified by the domain complexity; only the closing resource pointers could be tightened.

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, fiscally-regulated mutation with no output schema, the description covers the prerequisites, failure modes, side effects (AEAT submission, webhook, PDF), and where to find domain rules. An agent has everything needed to call it correctly and predict the outcome.

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 75%, so the description must add value, and it does: reason is described as required, minimum 10 characters, and fiscal data; void_date is flagged as deprecated with the issue-date rejection rule. issued_in_error's semantics are covered in both description and schema. idempotency_key is left entirely to the schema, hence not a 5.

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 (void) and resource (an issued invoice of this company), plus the scope constraint that the document is kept and the number never reused. It clearly distinguishes itself from siblings like beel_create_corrective_invoice and beel_delete_invoice by explaining the fiscal semantics of voiding versus correcting versus deleting.

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?

Explicit 'When to use it' section names the conditions (issued by mistake, test, accidental duplicate) and the primary alternative (issue a corrective invoice via POST …/{invoice_id}/corrective), including the withholding exception. It also states when the operation is blocked (live correctives, total correctives) and the issued_in_error precondition for sent/paid invoices.

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

Deploy Server

Other Tools