Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_create_corrective_invoice

Destructive

Issue a corrective invoice to amend an existing Spanish invoice, with TOTAL or PARTIAL rectification, ensuring AEAT VeriFactu compliance.

Instructions

Issues a corrective invoice that amends the invoice in the path. It is a new fiscal document with its own number, not an edit of the original. A TOTAL rectification leaves the original VOIDED; a PARTIAL one leaves it RECTIFIED and requires the adjustment lines, while TOTAL copies the original lines negated when they are omitted.

Only an ordinary or a simplified invoice in ISSUED, SENT, PAID, OVERDUE or RECTIFIED can be rectified. Rectifying a corrective fails with 422 CORRECTIVE_NOT_RECTIFIABLE — to fix an erroneous corrective, issue another one against the original invoice. A VOIDED invoice is no longer rectifiable, so a second TOTAL against the same invoice fails with 422 INVOICE_NOT_CORRECTIBLE_IN_CURRENT_STATUS; several PARTIAL correctives are allowed.

Omitting series_id numbers the document in the company's default corrective series, never in the series of the original, which is an ordinary or simplified one. That default is never created for you: if the company has none, the request fails with 422 SERIES_DEFAULT_NOT_FOUND; GET /v1/configuration/series/defaults-status reports which default is missing.

Endpoint: POST /v1/companies/{company_id}/invoices/{invoice_id}/corrective

⚠️ Fiscal guardrails — read before calling:

  • Choosing wrong here misreports to AEAT. The 30-second decision. (resource: beel://guardrails/cancel-vs-rectify)

  • How BeeL derives the AEAT invoice type, and the rules each type imposes. (resource: beel://guardrails/invoice-types)

  • How a line states its price, and which field combinations are rejected. (resource: beel://guardrails/invoice-lines)

  • When an invoice can still be changed, and what to do once it cannot. (resource: beel://guardrails/invoice-state-machine)

  • How invoice numbers are formed, and why numbering can never be rewritten. (resource: beel://guardrails/series-and-numbering)

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.
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 already signal readOnlyHint=false and destructiveHint=true, but the description goes far beyond: it specifies that TOTAL voids the original, PARTIAL leaves it RECTIFIED, describes series default creation behavior and the resulting 422 error codes, and warns about misreporting to AEAT with guardrail resources. This adds contextual side-effect information the annotations do not convey.

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 every section serves a purpose: purpose, behavioral consequences, status rules, series semantics, endpoint, and guardrails. It is front-loaded with the core purpose and structured in clear paragraphs. The length is justified by the complexity, though it could be slightly trimmed without losing value.

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 complex tool with no output schema, the description covers the core usage, status conditions, error scenarios, series handling, and points to guardrails and docs_search for exhaustive rules. It omits some details like idempotency_key behavior, but that is fully specified in the schema. Overall it provides enough for an agent to invoke the tool correctly without external research.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 75% and the schema itself thoroughly documents parameters like series_id, lines, and rectification_type. The description repeats some of these points (e.g., series default, line copying) but adds little new meaning beyond behavioral context like error codes. Since the schema carries the heavy lifting, the description adds marginal value here, hence a baseline 3.

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 clear verb and resource: 'Issues a corrective invoice that amends the invoice in the path.' It also explicitly distinguishes itself from editing ('It is a new fiscal document with its own number, not an edit of the original') and implies differentiation from void/patch tools. This leaves no ambiguity about the tool's function.

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 enumerates exactly which invoice statuses are rectifiable (ISSUED, SENT, PAID, OVERDUE, RECTIFIED), what to do when a corrective itself is faulty ('issue another one against the original invoice'), and when a TOTAL cannot be repeated (VOIDED invoice). It also clarifies series default behavior and points to guardrails for the cancel-vs-rectify decision, giving agents clear when-to-use and when-not-to-use guidance.

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