Skip to main content
Glama
BeeL MCP server

BeeL MCP server

Official
by beel-es

beel_convert_proforma_to_invoice

DestructiveIdempotent

Convert an ACTIVE proforma accepted by the customer into a STANDARD draft invoice linked to its source, optionally issuing it in the same atomic call.

Instructions

Converts an accepted proforma of this company into a real invoice. The new invoice is created as a STANDARD draft linked back through source_proforma_id.

  • What converts: only proformas in status ACTIVE. One shown as EXPIRED is still ACTIVE underneath and converts too.

  • The proforma: preserved as the record of what the customer accepted — it keeps its PRO-... number and PDF and moves to the terminal status CONVERTED.

  • issue: with true the new invoice is numbered and issued in the same atomic call. If issuing fails nothing is created and the proforma stays ACTIVE. That includes 400 SERIES_NUMBER_COLLISION: the number the series would assign is already used by another invoice of the same company, and the series needs review, so contact support.

  • Errors: 422 CONVERSION_REQUIRES_PROFORMA when the document is not a proforma, 422 PROFORMA_NOT_CONVERTIBLE when it is not ACTIVE, and 409 PROFORMA_ALREADY_CONVERTED when it has already been converted — a second call never creates a second invoice.

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

⚠️ Read before calling:

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

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_convert_proforma_to_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyNo
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.10.0
    • addedInput schema / properties / body / type
      Added value: +"object"
    • addedInput schema / properties / invoice_id / type
      Added value: +"string"
  2. Changed1 schema field changedv0.9.0
    • removedInput schema / $defs / ConvertProformaToInvoiceRequest / properties / verifactu_enabled
      Removed value: -{
      -  "description": "Whether the resulting invoice generates VeriFactu information.\n\n**If omitted, the company's declared preference applies** (the \"apply VeriFactu by\ndefault\" setting, `apply_by_default`) — the same resolution used when creating an\ninvoice. Send the field explicitly (`true` or `false`) to override it.\n\nThe proforma itself never carries VeriFactu, so it has no preference to pass on: the\ninvoice born from the conversion is a new fiscal document and follows the company's\npolicy, exactly like one created from scratch.\n\nThis matters most with `issue: true`, where there is no draft left to edit before\nthe invoice reaches AEAT.\n",
      -  "type": "boolean"
      -}
  3. Changed6 schema fields changedv0.5.0
    • addedInput schema / $defs / ConvertProformaToInvoiceRequest / additionalProperties
      Added value: +false
    • removedInput schema / $defs / ConvertProformaToInvoiceRequest / properties / issue / example
      Removed value: -false
    • removedInput schema / $defs / ConvertProformaToInvoiceRequest / properties / verifactu_enabled / example
      Removed value: -true
    • 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."
  4. First observedv0.3.1

TDQS

A4.5/5.0
Behavior5/5

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

Adds substantial behavior beyond the annotations (destructiveHint/idempotentHint/openWorldHint): atomic issuance with rollback, the fact that a failed issue leaves the proforma `ACTIVE` and nothing created, the terminal `CONVERTED` status and preservation of the `PRO-...` number/PDF, and that a second call never creates a second invoice. The enumerated error codes with meanings (SERIES_NUMBER_COLLISION, PROFORMA_NOT_CONVERTIBLE, PROFORMA_ALREADY_CONVERTED) are exactly the kind of context annotations cannot 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 one-sentence purpose, then organized under bolded bullets for what converts, the proforma's fate, `issue`, and errors — easy to scan. Slightly long, and the trailing guardrails pointer is a separate concern appended to the definition rather than integrated.

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?

For a destructive, atomic conversion mutation with no output schema, it covers preconditions, side effects, rollback, idempotency behavior and failure codes. The only real gap is what the response body contains (the new invoice id/number), which the agent would need to chain a follow-up call.

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 baseline is already high, and the description still adds meaning for `issue`: it explains the atomic numbering/issuance flow and the specific failure mode (`400 SERIES_NUMBER_COLLISION`) that callers should expect. `idempotency_key` and `company_id` are only covered by the schema, not the description, but their schema text is thorough, so the gap is small.

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 and resource ('converts an accepted proforma into a real invoice') and pins down the result shape: a `STANDARD` draft linked via `source_proforma_id`. That is clearly distinct from siblings like beel_create_invoice, beel_issue_invoice and beel_create_invoice_derivation.

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 the precondition for use ('only proformas in status `ACTIVE`'), including the useful edge case that an `EXPIRED`-looking proforma is still `ACTIVE` underneath. It does not explicitly name an alternative sibling or say when to prefer `issue: true` versus calling beel_issue_invoice afterwards, so the alternative routing is left implicit.

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