Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_delete_invoice

DestructiveIdempotent

Delete a draft invoice and automatically restore its originating proforma to active for editing. Issued invoices are never deleted—void them to maintain the fiscal trail.

Instructions

Deletes a draft invoice of this company. The record is marked as deleted rather than removed.

  • Issued invoices: never deleted. They are voided with POST …/{invoice_id}/void, which leaves the fiscal trail.

  • source_proforma_id: when the draft came from converting a proforma, deleting it returns that proforma from CONVERTED to ACTIVE, editable and convertible again. Voiding or rectifying an issued invoice does not return its proforma; only deleting the draft does.

Endpoint: DELETE /v1/companies/{company_id}/invoices/{invoice_id}

⚠️ 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
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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.5.0
    • 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.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false; on top of that the description discloses soft-delete semantics ('marked as deleted rather than removed'), the fiscal-trail guarantee for issued invoices, and the side effect of restoring a converted proforma from CONVERTED to ACTIVE. It also points to the invoice-state-machine guardrails. No contradiction with annotations.

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 core action is front-loaded in the first sentence, followed by scannable bullets with bolded lead-ins and a clear endpoint line. Though longer than average, every section carries distinct operational content — scope, exclusions, proforma side effect, guardrails — and ends with a pointer to docs_search for exhaustive rules.

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 destructive fiscal operation with no output schema, the description covers scope, soft-delete behavior, the void alternative, proforma restoration, and guardrails. Small gaps remain: no mention of the expected response/return value and no explicit permission requirements, though the schema covers 403 semantics via company_id. The pointer to exhaustive docs mitigates these gaps.

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 coverage is 100% and the company_id schema entry already explains context derivation and 403 semantics in detail. The description adds little beyond the endpoint URL template mapping parameters to path segments; invoice_id is only described as 'Invoice ID' in the schema and the description does not elaborate. Baseline 3 applies for high schema coverage.

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 the operation precisely — 'Deletes a draft invoice of this company' — with a specific resource and scope. It explicitly contrasts deleting drafts with voiding issued invoices, so an agent can distinguish it from beel_void_invoice, beel_patch_invoice, and beel_set_invoice_status without inspecting their schemas.

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?

Explicitly says drafts are the target and that issued invoices are 'never deleted' but voided via `POST …/{invoice_id}/void`, naming the alternative operation. The source_proforma_id bullet further differentiates delete from void/rectify behavior, and the guardrails pointer tells the agent where to check the invoice state machine before calling.

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