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. Dates show when Glama detected each change.

  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.5/5.0
Behavior4/5

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

Annotations convey readOnlyHint=false, destructiveness=false, and idempotence=false, but the description adds substantial behavioral context beyond that: true partial-update semantics (field-merge), immutable issued invoices, the corrective-invoice path, series_id cross-company restrictions, and clear warnings with a pointer to a state-machine resource. It does not hide mutation, but the description still doesn't fully enumerate all side effects such as number reassignment details or VeriFactu implications, so a 4 is appropriate. 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact relative to the size of the schema, and the single most important fact — partial-update merge semantics — is front-loaded in the first sentence. The bullet points and warning block are scannable and directly valuable. It earns a 4, not a 5, because the warning paragraph and the resource-reference protip are slightly generic and could be tightened into the bullets, but they add genuine routing 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 PATCH tool with a large nested body schema and no output schema, the description covers the essential operational constraints: draft-only modifiability, corrective/void alternatives, series/NIF non-interaction, and partial merge semantics. Without an output schema, it would be helpful to state the response shape or confirmation signal, but the schema's UpdateInvoiceRequest already defines the request contract in detail, and the description routes to guardrails and docs search for rules. Missing a few edge behaviors like number renumbering and response contents, hence 4.

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?

Schema coverage is 67%, meaning the schema already documents company_id and invoice_id well, but the body schema (UpdateInvoiceRequest) carries most of the semantic weight through deep property descriptions. The tool description itself contributes the key partial-update semantics: 'only fields present in the body' are applied, plus the series_id and status guardrails. For the two ID parameters the schema is sufficient; for body behavior the description meaningfully supplements the schema with mutation semantics and redirects to exhaustive docs.

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 clear, specific verb and resource: 'Updates only the fields present in the body, leaving every other field of the invoice as it is.' It precisely distinguishes partial PATCH semantics from full updates or other invoice operations. The sibling list includes several invoice-related tools (create, delete, issue, void, corrective), and this description makes the PATCH-merge behavior unambiguous.

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 explicitly states when to use this tool via the status constraint: only draft invoices can be modified, and issued ones must go through the corrective-invoice endpoint or voiding. It also clarifies series_id behavior relative to NIF/company context. The fiscal guardrails section even routes the agent to a dedicated resource (beel://guardrails/invoice-state-machine) and to beel_docs_search for exhaustive rules, which is strong alternative-navigation 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