Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_set_invoice_status

Idempotent

Set an invoice's commercial status to ISSUED, SENT, or PAID while enforcing valid transitions; issuing and voiding remain separate fiscal operations.

Instructions

Sets the commercial status of an invoice. Any transition other than the ones below is rejected.

  • PAID: from ISSUED, SENT or OVERDUE.

  • SENT: from ISSUED.

  • ISSUED: from SENT only, to undo a SENT set by mistake.

  • Not set here: issuing and voiding are fiscal acts with their own operations (POST …/{invoice_id}/issue, POST …/{invoice_id}/void), and issuing is never undone.

Endpoint: PUT /v1/companies/{company_id}/invoices/{invoice_id}/status

⚠️ Read before calling:

  • 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.
invoice_idYesInvoice ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.9.0
    • changedInput schema / $defs / PaymentMethod / description
      Previous value: -"Payment method for invoices and recurring invoices.\nNONE means no payment information will be shown.\n"New value: +"Payment method shown on invoices and recurring invoices.\n\n- `NONE`: no payment information is shown.\n- `BANK_TRANSFER`: bank transfer to the IBAN of the payment details; the only method\n  that requires an IBAN.\n- `CARD`: card payment.\n- `CASH`: cash payment.\n- `CHECK`: payment by cheque.\n- `DIRECT_DEBIT`: direct debit from the customer's bank account.\n- `BIZUM`: payment through Bizum.\n- `OTHER`: any other method.\n"
  2. Changed11 schema fields changedv0.5.0
    • removedInput schema / $defs / IBAN / example
      Removed value: -"ES1234567890123456789012"
    • addedInput schema / $defs / PaymentInfo / additionalProperties
      Added value: +false
    • removedInput schema / $defs / PaymentInfo / properties / payment_term_days / example
      Removed value: -30
    • removedInput schema / $defs / PaymentMethod / example
      Removed value: -"BANK_TRANSFER"
    • removedInput schema / $defs / SWIFT / example
      Removed value: -"ABCDESMMXXX"
    • addedInput schema / $defs / SetInvoiceStatusRequest / additionalProperties
      Added value: +false
    • removedInput schema / $defs / SetInvoiceStatusRequest / properties / payment_date / example
      Removed value: -"2025-01-15"
    • removedInput schema / $defs / SetInvoiceStatusRequest / properties / sent_at / example
      Removed value: -"2025-01-29T18:45:00Z"
    • 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."
  3. First observedv0.3.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly=false, idempotent=true, destructive=false, so the safety profile is covered. The description adds genuinely non-structured behavior: invalid transitions are rejected by the domain, and issuing is irreversible and is never undone here. It stops short of describing the response or side effects like sent_at bookkeeping (left to the schema).

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 purpose, then organized as scannable bullets with the endpoint and a read-first warning. It is slightly repetitive of the schema's own transition prose and the guardrail pointer duplicates text already present in the nested request description.

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 3-param mutation with no output schema, the description covers the state machine, exclusions, endpoint and a referenced guardrail resource. It does not say what the call returns or whether the invoice body is mutated in response, a minor gap given no output schema is declared.

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 67% and the schema already spells out the status enum transitions, sent_at, payment_date and payment_method semantics. The description's transition table largely restates the status parameter rather than adding new meaning, so the baseline 3 applies.

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 and resource ('Sets the commercial status of an invoice') and immediately bounds it with the exact allowed transitions. It also distinguishes itself from the fiscal acts performed by siblings beel_issue_invoice and beel_void_invoice by pointing at their dedicated operations.

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?

Gives per-target preconditions ('PAID: from ISSUED, SENT or OVERDUE') and explicit exclusions under 'Not set here', naming the alternative operations for issuing and voiding. It also calls out the intent of ISSUED (undo a mistaken SENT), so the agent knows when to reach for it versus never.

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