Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_convert_proforma_to_invoice

Convert an accepted proforma into a draft or issued invoice, preserving the proforma as the customer's record. Handles ACTIVE and EXPIRED statuses, with atomic issuance and duplicate prevention.

Instructions

Converts an accepted proforma of this company into a real invoice. Only proformas in status ACTIVE convert; one shown as EXPIRED is still ACTIVE underneath and converts too. The proforma is preserved as the record of what the customer accepted: it keeps its PRO-... number and PDF and moves to the terminal status CONVERTED.

The call creates a new STANDARD invoice in DRAFT, linked back through source_proforma_id. With issue: true that invoice is numbered and issued in the same atomic call: if issuing fails, nothing is created and the proforma stays ACTIVE. 422 CONVERSION_REQUIRES_PROFORMA when the document is not a proforma, 422 PROFORMA_NOT_CONVERTIBLE when it is not in 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_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
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.
Behavior5/5

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

Annotations are minimal (readOnlyHint false, etc.), so the description carries the full burden—and it excels. It discloses atomicity (issue:true fails together), state transitions (proforma preserved, moves to CONVERTED), error semantics (422 vs 409), side effects (new invoice with source_proforma_id), and the VeriFactu policy resolution. No contradiction with annotations; it enriches them significantly, painting a complete behavioral picture an agent needs to avoid mistakes.

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 long but structured: a clear lead sentence, then a paragraph on the conversion process, error list, endpoint, a warning callout for fiscal guardrails, and a pointer to docs. Every section earns its place, and the critical operational details are front-loaded. The only minor deduction is that the warning about guardrails could be integrated earlier, but overall it is well-organized and not bloated.

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 complex fiscal operation with no output schema, this description is exceptionally complete. It covers the input conditions, the exact outcome, error scenarios, atomicity, idempotency, and fiscal guardrail resource. It also links to docs for exhaustive rules, ensuring an agent knows where to get more detail. Nothing critical is missing for correct invocation—only the actual response format is omitted, but that's acceptable given the absence of an output schema and the pointer to docs.

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 provides detailed descriptions for issue and verifactu_enabled (covering defaults and overrides), and the description adds a concise note on issue:true's atomic behavior. For idempotency_key, the schema explains the blind retry behavior; the description doesn't add much there, but that's acceptable since schema coverage is 75%. The description adds value precisely where it matters most—highlighting the issue flag's side effects—without redundancy.

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+resource statement: 'Converts an accepted proforma of this company into a real invoice.' It immediately distinguishes from siblings by specifying the input status (ACTIVE), the output type (STANDARD DRAFT invoice), and the linkage (source_proforma_id). This is far more specific than vague alternatives like 'create_invoice' and leaves no doubt about its unique role.

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 states when to use: only for accepted proformas in ACTIVE status, and even clarifies that EXPIRED proformas are still convertible because they remain ACTIVE underneath. It covers what happens on failure (422 errors) and idempotency (409 on second call), and points to a dedicated guardrails resource for the state machine. It also implies alternatives by directing to docs for exhaustive rules, effectively guiding the agent on boundaries without being redundant.

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