Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_create_simplified_exchange

Idempotent

Issues a full standard invoice that replaces one or more simplified invoices when a customer requests their tax details on it, voiding the originals as exchanged.

Instructions

Issues a full invoice in exchange for one or more simplified invoices already issued, when the customer asks for an invoice with their details. It is not a corrective invoice: it documents the same operations again with the recipient identified (RD 1619/2012, art. 15.6).

  • What it issues: a STANDARD invoice with the lines of the simplified invoices and the recipient sent, numbered in series_id or in the company's default standard series. It lists the invoices it replaces in replaced_invoice_ids, and the AEAT records it as F3, identifying them.

  • The simplified invoices: each becomes VOIDED with void_cause EXCHANGED, in the same act: their records are not cancelled, the exchange replaces them. They must be simplified invoices (422 EXCHANGE_REQUIRES_SIMPLIFIED), issued and not voided, exchanged or corrected before (422 SIMPLIFIED_NOT_EXCHANGEABLE).

  • The exchange invoice cannot be voided afterwards (422 EXCHANGE_INVOICE_NOT_VOIDABLE); if it has an error, it is corrected with a corrective invoice.

  • VeriFactu: while the exchange cannot yet be recorded as F3, an exchange that would be submitted to the AEAT fails with 422 SIMPLIFIED_EXCHANGE_NOT_RECORDABLE and nothing is issued.

Endpoint: POST /v1/companies/{company_id}/invoices/simplified-exchanges

⚠️ Read before calling:

  • Fiscal rules, domains simplified, records: beel_rules_list with domain, or resource beel://guardrails/.

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

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.
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. Addedv0.9.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that the source invoices become VOIDED with cause EXCHANGED (records preserved), that the exchange invoice cannot be voided afterwards, the exact 422 error codes for each failure mode, and the VeriFactu F3 gating behavior. This is rich side-effect disclosure that the readOnlyHint=false/destructiveHint=false/idempotentHint=true annotations alone do not convey.

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?

Long but well front-loaded: the core purpose is in the first sentence, followed by scannable bolded bullets for what it issues, source-invoice handling, voidability, and VeriFactu. Each block earns its place, though the prose is dense enough that a tighter version is imaginable.

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?

With no output schema, the description compensates by naming the response-relevant fields (replaced_invoice_ids, F3/AEAT registration, verifactu state) and pointing to guardrail resources for pre-flight checks. An agent has enough to call it correctly, though return-shape detail remains implicit.

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 67%, and the description adds real meaning on top: it explains that simplified_invoice_ids must be issued, non-voided, non-exchanged, non-corrected invoices whose lines carry over in order, and clarifies the recipient/series defaults. It does not, however, explain the options/idempotency_key fields, leaving some schema work uncovered.

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+resource ('Issues a full invoice in exchange for one or more simplified invoices already issued') and explicitly distinguishes itself from the sibling concept 'It is not a corrective invoice'. An agent can tell exactly what this produces and what it does not.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear triggering scenario ('when the customer asks for an invoice with their details') and rules out the nearest alternative (corrective invoice), plus preconditions for the source invoices. It stops short of naming sibling tools like beel_create_corrective_invoice or beel_create_invoice as explicit alternatives, so it is clear context without full routing.

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