Skip to main content
Glama

beel_create_corrective_invoice

DestructiveIdempotent

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.

  • rectification_type: TOTAL leaves the original VOIDED and copies its lines negated when lines is omitted. PARTIAL leaves the original RECTIFIED and requires the adjustment lines.

  • What can be rectified: an ordinary or simplified invoice in ISSUED, SENT, PAID, OVERDUE or RECTIFIED. Rectifying a corrective fails with 422 CORRECTIVE_NOT_RECTIFIABLE — to fix an erroneous corrective, issue another one against the original invoice.

  • Repeat rectifications: several PARTIAL correctives are allowed, but a VOIDED invoice is no longer rectifiable, so a second TOTAL against the same invoice fails with 422 INVOICE_NOT_CORRECTIBLE_IN_CURRENT_STATUS.

  • series_id: when omitted, the document is numbered in the company's default corrective series, never in the series of the original. That default is never created for you: if the company has none the request fails with 422 SERIES_DEFAULT_NOT_FOUND, and 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_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.

TDQS

A4.8/5.0
Behavior5/5

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

Even with annotations providing readOnlyHint=false, idempotentHint=true, and destructiveHint=true, the description adds substantial behavioral context: TOTAL leaves the original VOIDED with negated lines, PARTIAL leaves it RECTIFIED, repeat rectification rules, specific 422 failure codes, and series-numbering behavior. This goes far beyond what the annotations alone communicate.

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 long but tightly structured with bolded parameter names, clear bullets, and a distinct guardrails section. It is front-loaded with the core concept, then covers state changes, failure modes, series behavior, and related resources. Every section earns its place given the fiscal complexity.

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 status rules, error codes, series defaults, and links to five relevant guardrails plus docs search, which is extensive for a complex fiscal operation. It does not describe the response shape, and there is no output schema to compensate, but it provides enough operational guardrails that an agent can invoke the tool correctly.

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 description adds decision-oriented meaning to key parameters: it explains the rectification_type semantics, when lines may be omitted, and how series_id falls back to the company default corrective series and never the original's. With schema coverage at 75%, this does not fully replace the schema but makes the most consequential parameter interactions much easier to reason about.

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 opening sentence states a specific verb and resource: 'Issues a corrective invoice that amends the invoice in the path.' It further distinguishes the operation by clarifying it is 'a new fiscal document with its own number, not an edit of the original,' which separates it clearly from ordinary invoice creation and invoice patching.

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?

The description gives explicit conditions for use: it lists which invoice types and statuses are rectifiable, states that PARTIAL versus TOTAL behave differently, explains that rectifying a corrective fails, and gives the alternative action of issuing another corrective against the original. It also points to the cancel-vs-rectify guardrail, effectively telling the agent when this tool is appropriate versus alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A3.7/5.0
Disambiguation4/5

Each tool targets a distinct resource-action pair, and the detailed descriptions separate lookalikes like create_invoice, create_invoice_derivation, and create_invoice_delivery. The sheer number of tools makes selection harder, and a few same-verb clusters still demand close reading, but there are no true functional duplicates.

Naming Consistency4/5

Names follow a consistent beel_verb_noun pattern with clear CRUD verbs (create/get/list/patch/delete) plus domain verbs like issue, void, send, and retry. Minor inconsistencies remain: PATCH operations are sometimes patch_*, sometimes update_* or set_*, and there is an outlier put_member_grant.

Tool Count1/5

121 tools is far beyond the 50+ threshold and is an extreme mismatch for a tool surface, however broad the underlying API. Even with clean naming, this many tools forces agents to repeatedly scan a massive list and should be consolidated or split into focused servers.

Completeness4/5

The surface covers most lifecycles exhaustively: companies, customers, invoices, products, series, recurring invoices, webhooks, members, payment events, and tax configuration. A few sub-flows have dead ends — representation generation/download/cancel exist but no submit tool, and logo deletion exists without an upload tool — so it falls just short of full coverage.