Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_convert_proforma_to_invoice

DestructiveIdempotent

Convert an accepted proforma into a real invoice, leaving the original as a converted record. Optionally issue the new invoice in the same call, with safeguards against duplicate conversions.

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.

  • 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.

Endpoint: POST /v1/companies/{company_id}/invoices/{invoice_id}/convert-to-invoice

⚠️ 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)

For the exhaustive rules and worked examples, call beel_docs_search.

Input Schema

TableJSON 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. 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."
  2. 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, the description discloses key behaviors: the proforma is preserved with its `PRO-...` number and PDF and moves to terminal status `CONVERTED`; `issue: true` is atomic and on failure nothing is created and the proforma stays `ACTIVE`; repeated calls never create a second invoice; exact HTTP error codes are listed. This is extensive, useful behavioral disclosure, and it does not contradict the annotations.

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 dense but well-organized: a clear one-line purpose, bullets for behavior, error cases, endpoint, and guardrail pointer. Every section earns its place and the most important conversion semantics are front-loaded.

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?

The description covers the operation's states, error cases, atomicity, and even fiscal guardrails. It lacks an explicit statement of the response shape or a direct mapping saying the `invoice_id` parameter is the proforma's ID, which would matter because the schema labels it only as 'Invoice ID.' With no output schema, that small gap prevents a perfect score.

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?

The input schema already documents most parameters thoroughly, including `issue` and `verifactu_enabled`. The description adds meaningful cross-parameter consequence not in the schema: with `issue: true`, failure leaves the proforma `ACTIVE` and creates nothing. It does not discuss `verifactu_enabled`, but the schema carries that weight, so this clears the baseline.

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: 'Converts an accepted proforma of this company into a real invoice.' It further specifies the result is a `STANDARD` draft linked via `source_proforma_id`, which clearly distinguishes it from sibling tools like `beel_create_invoice`, `beel_issue_invoice`, and `beel_create_corrective_invoice`.

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?

The description gives clear eligibility context: only proformas in status `ACTIVE` convert, including ones displayed as `EXPIRED`, and enumerates the exact error conditions. It does not explicitly state 'use X instead of Y,' but the tool is highly specialized and the eligibility rules plus pointer to docs make invocation context clear.

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