Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_patch_invoice

Partially update a draft invoice by changing only the fields you provide, leaving the rest untouched. Drafts only; issued invoices require a corrective invoice or void.

Instructions

Updates only the fields present in the body, leaving every other field of the invoice as it is.

  • Status: only a draft invoice can be modified. An issued one is amended with a corrective invoice (POST …/{invoice_id}/corrective) or voided.

  • Series: changing series_id never moves the invoice to another NIF — a series of another company is not visible from here.

Endpoint: PATCH /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
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. Changed51 schema fields changedv0.5.0
    • addedInput schema / $defs / Address / additionalProperties
      Added value: +false
    • removedInput schema / $defs / Address / properties / city / example
      Removed value: -"Madrid"
    • removedInput schema / $defs / Address / properties / country / example
      Removed value: -"España"
    • removedInput schema / $defs / Address / properties / country_code / example
      Removed value: -"ES"
    • removedInput schema / $defs / Address / properties / door / example
      Removed value: -"A"
    • removedInput schema / $defs / Address / properties / floor / example
      Removed value: -"2º A"
    • removedInput schema / $defs / Address / properties / number / example
      Removed value: -"123"
    • removedInput schema / $defs / Address / properties / postal_code / example
      Removed value: -"28001"
    • removedInput schema / $defs / Address / properties / province / example
      Removed value: -"Madrid"
    • removedInput schema / $defs / Address / properties / street / example
      Removed value: -"Calle Mayor, 123"
    • removedInput schema / $defs / Email / example
      Removed value: -"user@example.com"
    • addedInput schema / $defs / EmailConfiguration / additionalProperties
      Added value: +false
    • removedInput schema / $defs / EmailConfiguration / example
      Removed value: -{
      -  "cc": [
      -    "accounting@example.com"
      -  ],
      -  "message": "Please find attached the requested invoice. We remain at your disposal for any clarification.",
      -  "recipients": [
      -    "client@example.com"
      -  ],
      -  "subject": "Invoice 2025/0001 - Development services"
      -}
    • removedInput schema / $defs / EmailConfiguration / properties / cc / example
      Removed value: -[
      -  "copy@example.com"
      -]
    • removedInput schema / $defs / EmailConfiguration / properties / message / example
      Removed value: -"Dear customer, please find attached the invoice for the services provided. Thank you for your trust."
    • removedInput schema / $defs / EmailConfiguration / properties / recipients / example
      Removed value: -[
      -  "client@example.com"
      -]
    • removedInput schema / $defs / EmailConfiguration / properties / subject / example
      Removed value: -"Invoice 2025/0001 - Web development services"
    • removedInput schema / $defs / EquivalenceSurchargePercentage / example
      Removed value: -5.2
    • removedInput schema / $defs / ExemptionReason / example
      Removed value: -"EXENTA_ART_20"
    • removedInput schema / $defs / IBAN / example
      Removed value: -"ES1234567890123456789012"
    • removedInput schema / $defs / InvoiceLineType / example
      Removed value: -"NORMAL"
    • removedInput schema / $defs / IrpfPercentage / example
      Removed value: -15
    • 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 / Phone / example
      Removed value: -"+34 612 345 678"
    • addedInput schema / $defs / Recipient / additionalProperties
      Added value: +false
    • removedInput schema / $defs / Recipient / example
      Removed value: -{
      -  "customer_id": "4f244735-980b-8d9c-80e8-6331fa0b1958"
      -}
    • removedInput schema / $defs / Recipient / properties / customer_id / example
      Removed value: -"4f244735-980b-8d9c-80e8-6331fa0b1958"
    • removedInput schema / $defs / Recipient / properties / legal_name / example
      Removed value: -"Tech Solutions SL"
    • removedInput schema / $defs / Recipient / properties / nif / example
      Removed value: -"B12345674"
    • removedInput schema / $defs / Recipient / properties / trade_name / example
      Removed value: -"TechSol"
    • removedInput schema / $defs / RegimeKey / example
      Removed value: -"01"
    • removedInput schema / $defs / SWIFT / example
      Removed value: -"ABCDESMMXXX"
    • addedInput schema / $defs / TaxInfo / additionalProperties
      Added value: +false
    • removedInput schema / $defs / TaxInfo / example
      Removed value: -{
      -  "percentage": 21,
      -  "regime_key": "01",
      -  "type": "IVA"
      -}
    • removedInput schema / $defs / TaxInfo / properties / percentage / example
      Removed value: -21
    • removedInput schema / $defs / TaxType / example
      Removed value: -"IVA"
    • removedInput schema / $defs / UUID / example
      Removed value: -"550e8400-e29b-41d4-a716-446655440000"
    • addedInput schema / $defs / UpdateInvoiceRequest / additionalProperties
      Added value: +false
    • addedInput schema / $defs / UpdateInvoiceRequest / properties / lines / items / additionalProperties
      Added value: +false
    • removedInput schema / $defs / UpdateInvoiceRequest / properties / lines / items / properties / exemption_reason / $ref
      Removed value: -"#/$defs/ExemptionReason"
    • addedInput schema / $defs / UpdateInvoiceRequest / properties / lines / items / properties / exemption_reason / anyOf
      Added value: +[
      +  {
      +    "$ref": "#/$defs/ExemptionReason"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / $defs / UpdateInvoiceRequest / properties / lines / items / properties / total_excluding_tax / example
      Removed value: -1
    • removedInput schema / $defs / UpdateInvoiceRequest / properties / lines / items / properties / total_including_tax / example
      Removed value: -100
    • addedInput schema / $defs / UpdateInvoiceRequest / properties / options / additionalProperties
      Added value: +false
    • removedInput schema / $defs / UpdateInvoiceRequest / properties / options / properties / email_config / allOf
      Removed value: -[
      -  {
      -    "$ref": "#/$defs/EmailConfiguration"
      -  }
      -]
    • addedInput schema / $defs / UpdateInvoiceRequest / properties / options / properties / email_config / anyOf
      Added value: +[
      +  {
      +    "allOf": [
      +      {
      +        "$ref": "#/$defs/EmailConfiguration"
      +      }
      +    ],
      +    "description": "Email configuration for auto-send. null clears the existing config."
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / $defs / UpdateInvoiceRequest / properties / options / properties / email_config / description
      Removed value: -"Email configuration for auto-send. null clears the existing config."
    • 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?

Beyond the annotations (readOnlyHint=false, destructiveHint=false), the description discloses partial-update semantics, draft-only mutability, the corrective/void path for issued invoices, and the series-does-not-change-NIF behavior. It also surfaces a fiscal guardrail resource before calling, which is meaningful extra behavioral context.

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 semantics are front-loaded in the first line, followed by a compact bulleted status/series section, endpoint, and guardrail pointer. Every sentence earns its place and the description is appropriately scoped for the tool's 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?

For a complex PATCH with no output schema, the description covers state constraints, endpoint, series behavior, and where to get exhaustive fiscal rules. It doesn't mention the response shape or common error cases, but the explicit links to guardrails and beel_docs_search make it sufficient for correct selection and invocation.

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?

The body/partial-update semantics are largely duplicated by the schema's UpdateInvoiceRequest description, and company_id/invoice_id are self-explanatory UUIDs. The description adds the useful series_id caveat (no NIF move, series visibility), but at 67% schema coverage it does not substantially compensate for the remaining parameter meaning.

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 opens with a specific action and resource — 'Updates only the fields present in the body, leaving every other field of the invoice as it is' — and clarifies scope via status and series constraints. This distinguishes it clearly from creation, issuing, corrective, and voiding tools.

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 explicitly states when the tool applies ('only a draft invoice can be modified') and names alternatives for issued invoices: corrective invoice via POST .../corrective or voiding. It also flags a series/NIF edge case and points to guardrails and docs for exhaustive rules, so an agent can route correctly.

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