Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_create_invoice_derivation

Idempotent

Creates a draft invoice by duplicating an existing one, copying recipient, lines, and payment method while resetting numbers, dates, and PDF. The source invoice remains unchanged.

Instructions

Creates a draft invoice derived from an existing invoice of this company. The source invoice, named in from_invoice_id, is not modified.

  • mode: the only value is DUPLICATE, which copies the source into a fresh draft. Recipient, lines, payment method, series and observations are copied; number, status, dates, VeriFactu data and PDF are reset.

  • Series: the one sent in series_id, or the source's when omitted. It is validated against the type of the copy, which is not always the source's: the copy of a CORRECTIVE is born STANDARD. An incompatible series fails with 422 SERIES_INCOMPATIBLE_DOC_TYPE.

Endpoint: POST /v1/companies/{company_id}/invoices/derivations

⚠️ Read before calling:

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

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

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. Changed4 schema fields changedv0.5.0
    • addedInput schema / $defs / CreateInvoiceDerivationRequest / additionalProperties
      Added value: +false
    • 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.5/5.0
Behavior5/5

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

Annotations only declare the safety profile (not read-only, idempotent, non-destructive). The description adds substantial behavioral detail beyond that: the source is left untouched, exactly which fields are copied versus reset (number, status, dates, VeriFactu data, PDF), that a CORRECTIVE copy is born STANDARD, and the concrete 422 SERIES_INCOMPATIBLE_DOC_TYPE failure mode.

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 core action and the key invariant (source unmodified), then bulleted detail on mode and series, then a clearly marked 'read before calling' block. Each section earns its place, though the guardrails pointer adds some length.

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 mutation tool with no output schema, the description covers side effects, copied/reset fields, series validation, and an explicit error code, and routes the agent to lifecycle resources. It stops short of describing the returned draft's shape, but the resource pointers compensate adequately.

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%, so the schema documents mode, series_id, from_invoice_id and notes. The description still adds real meaning: series_id is validated against the copy's type (which may differ from the source's), the source's series is the fallback, and the mode's only legal value is DUPLICATE. It goes beyond restating schema text.

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 ('Creates a draft invoice derived from an existing invoice of this company') and immediately disambiguates the operation from a plain create by noting the source is not modified. It is distinguishable from siblings like beel_create_invoice and beel_convert_proforma_to_invoice without opening any schema.

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?

Explains the single mode (DUPLICATE) and what it copies versus resets, plus points the agent at beel_rules_list and the invoice-state-machine resource for the fiscal rules and lifecycle. It does not explicitly say when to prefer this over beel_create_invoice or beel_convert_proforma_to_invoice in prose, but the context is 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