Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_create_invoice_derivation

Duplicate an existing invoice into a new draft, copying key details while resetting fiscal data. Validates series compatibility to prevent errors.

Instructions

Creates a draft invoice derived from an existing invoice of this company, named in from_invoice_id with mode: DUPLICATE. Recipient, lines, payment method, series and observations are copied; number, status, dates, VeriFactu data and PDF are reset. The source invoice is not modified.

The series — the one sent in series_id or the source's, inherited — 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

⚠️ 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
bodyYes
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.
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?

Beyond the minimal annotations (readOnlyHint false, destructiveHint false), the description discloses important behavioral details: the source invoice is not modified, specific fields are reset, and series validation may fail with a specific error (422 SERIES_INCOMPATIBLE_DOC_TYPE). It also highlights fiscal guardrails and points to documentation for edge cases. This is rich behavioral context that goes well beyond what annotations provide.

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 longer than typical but well-structured: a clear opening sentence states the purpose, followed by copy/reset details, a note on series validation, the endpoint, a guardrail warning, and a pointer to docs. Each section earns its place, though some redundancy exists (e.g., repeating the mode and source behavior). It is effectively front-loaded and easy to scan, but could be slightly tightened.

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?

Given the complexity of the operation, the absence of an output schema, and the detailed input schema, the description covers essential aspects: what gets copied and reset, the source not being modified, series validation and error handling, and where to find exhaustive rules. It does not explicitly state the return value, but that is consistent with the lack of an output schema and is not required for correct invocation. The references to docs and guardrails fill remaining gaps, making it sufficiently complete.

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?

With schema description coverage at 67% (two of three parameters documented in detail), the description compensates by explaining the conceptual role of parameters: from_invoice_id names the source, mode DUPLICATE copies it, and series_id defaults to the source's. It clarifies the intent that this call does not describe an invoice but names one, which adds meaning beyond the schema's property descriptions. However, it does not dwell on idempotency_key semantics, which are already present in the schema, so the added value is strong but not exhaustive.

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: 'Creates a draft invoice derived from an existing invoice'. It details exactly what is copied and reset (recipient, lines, payment method, series, observations, number, status, dates, VeriFactu data, PDF) and distinguishes itself from beel_create_invoice by explaining this call names a source invoice rather than describing one, and from beel_convert_proforma_to_invoice by noting it is not a derivation mode. This makes the purpose unambiguous and clearly separates it from siblings.

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 provides clear context for when to use this tool: it is for duplicating an existing invoice, explicitly contrasting with the standard create request ('not a variant of the create request on purpose') and mentioning that turning a proforma into an invoice is a different operation. It also advises consulting fiscal guardrails and points to beel_docs_search for exhaustive rules. However, it does not explicitly enumerate all sibling alternatives in a structured when/when-not form, so it falls just short of a 5.

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