Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_issue_invoice

Finalize a draft invoice by assigning its definitive number and making it immutable, then submit it for PDF and VeriFactu processing.

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 or voided, never edited.

PDF and VeriFactu submission are asynchronous: a 200 means accepted for submission, never registered with AEAT.

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

⚠️ Fiscal guardrails — read before calling:

  • When an invoice can still be changed, and what to do once it cannot. (resource: beel://guardrails/invoice-state-machine)

  • Why an issued invoice may never reach AEAT, and how to tell before issuing. (resource: beel://guardrails/verifactu-gates)

For the exhaustive rules and worked examples, call beel_docs_search.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
company_idYesNIF (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.
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`).
Behavior5/5

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

Beyond annotations (readOnlyHint=false, destructiveHint=false), the description discloses critical behavior: irreversibility, asynchronous PDF/VeriFactu submission, and that a 200 only means accepted, not registered with AEAT. It also flags fiscal guardrails with resource pointers. This goes well beyond the structured fields and preempts common misuse.

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 well-structured: it opens with the core purpose, then the async caveat, then the endpoint, then fiscal guardrails as a warning block. Every sentence carries substantial information; the use of bullet points for guardrails improves scannability. Despite its length, it is tightly packed with essential facts and no 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?

Given the complexity (irreversibility, async behavior, fiscal obligations) and the absence of an output schema, the description covers all necessary operational aspects: what it does, how to handle failure, why it may not reach AEAT, and where to find exhaustive rules. The parameter schema handles all argument details, so nothing essential is missing for correct invocation.

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?

Input schema coverage is 100%, so all five parameters (company_id, invoice_id, wait_for_pdf, idempotency_key, attach_source_invoices) are already fully documented in the schema with descriptions. The tool description does not add parameter-specific meaning beyond what the schema provides, so the baseline of 3 applies.

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 opens with a precise verb and resource: 'Finalizes a draft invoice of this company: assigns its definitive number from the configured series and makes it immutable.' It clearly distinguishes the operation from siblings like beel_void_invoice and beel_create_corrective_invoice by stating its exact role and irreversibility. The purpose could not be misread.

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 tells the agent when to call it (on a draft invoice) and points to guardrails for when an invoice can still be changed and what to do once it cannot. It also mentions that PDF and VeriFactu submission are asynchronous, setting expectations for the call. It directs to beel_docs_search for exhaustive rules, giving a clear escalation path. Alternative operations (corrective invoice or void) are named implicitly.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/beel-es/beel-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server