Skip to main content
Glama
BeeL MCP server

BeeL MCP server

Official
by beel-es

beel_issue_invoice

DestructiveIdempotent

Finalize a draft invoice by assigning its definitive number and making it immutable for AEAT submission; correct or void it afterward instead of editing.

Instructions

Finalizes a draft invoice of this company: assigns its definitive number from the configured series and makes it immutable.

  • Irreversible: an issued invoice is corrected with a corrective invoice (POST …/{invoice_id}/corrective) or voided (POST …/{invoice_id}/void), never edited.

  • Asynchronous: PDF generation and submission to the AEAT happen after the response, so a 200 means the invoice was accepted for submission, not that the AEAT has registered it. Use wait_for_pdf to wait for the PDF.

  • Nothing to collect: a STANDARD or SIMPLIFIED invoice whose total_to_pay is 0 is issued as PAID, with payment_date equal to issue_date. It is registered with the AEAT like any other invoice, with a total of 0.

BeeL API endpoint: POST /v1/companies/{company_id}/invoices/{invoice_id}/issue (reference: https://docs.beel.es)

⚠️ Read before calling:

  • Fiscal rules, domains lifecycle, records: 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)

  • How to tell, before issuing, whether a NIF can issue, and what each blocker means. (resource: beel://guardrails/verifactu-gates)

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": "beel_issue_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
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
wait_for_pdfNoIf `true`, waits for PDF generation and returns the URL in the response. Adds ~1-2s of latency but guarantees the PDF is immediately available.
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.
attach_source_invoicesNoOnly applies when the invoice has automatic email sending enabled. If `true`, the email sent after issuing also attaches a ZIP (`suplidos_<invoice-number>.zip`) with the PDFs of the source invoices referenced by the invoice's SUPLIDO consolidation lines. Access to sources owned by managed accounts is re-checked with the same rules as issuing, and the request fails synchronously with an actionable error — never a partial ZIP — if the invoice has no consolidation sources (`ATTACH_SOURCE_INVOICES_NO_SOURCES`), a source is not reachable (`ATTACH_SOURCE_INVOICE_UNAVAILABLE`) or a source has no generated PDF (`ATTACH_SOURCE_PDF_MISSING`).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.0
    • addedInput schema / properties / invoice_id / type
      Added value: +"string"
  2. Changed3 schema fields changedv0.5.0
    • removedInput schema / $defs / UUID / example
      Removed value: -"550e8400-e29b-41d4-a716-446655440000"
    • 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.6/5.0
Behavior5/5

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

Beyond the annotations, it discloses that issuance is irreversible, asynchronous for PDF and AEAT submission, and has special behavior for zero-total invoices. It also clarifies that a 200 means accepted for submission rather than AEAT-registered.

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 well structured and front-loads the core irreversible action before covering asynchronous behavior and edge cases. It is long but mostly justified by the complexity of fiscal issuance, though some parameter guidance overlaps with the schema.

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, asynchronous fiscal mutation with no output schema, the definition covers the essential operational and behavioral context. It also points to the exact guardrail resources needed to resolve issuance preconditions.

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 description coverage is already 100%, and the schema documents the parameters in detail. The description reinforces wait_for_pdf as the way to wait for the PDF, but it does not add materially new semantics for company_id, invoice_id, idempotency_key, or attach_source_invoices.

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 states a specific verb and resource: it finalizes a draft invoice, assigns its definitive number, and makes it immutable. It clearly distinguishes issuing from editing by naming corrective invoices and voiding as the only post-issue remedies.

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?

It explicitly explains when to use this operation, that it is irreversible, and which alternatives exist for correcting or voiding an issued invoice. It also directs the agent to guardrail resources for fiscal rules, invoice lifecycle, and issuance blockers.

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