Skip to main content
Glama
beel-es

BeeL MCP server

Official
by beel-es

beel_patch_series

Partially update an invoice series: change only the fields you send, keep the rest as-is, and protect numbering once invoices are issued.

Instructions

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

  • Clearing a field: a field sent as null is cleared, which only description supports.

  • Numbering fields: code, format, counter_reset and initial_number are rejected once the series has issued invoices (numbering_locked is true).

  • Unique numbers per issuer: changing code, format or document_type so that the series could print a number another series of the company can also print is rejected with 409 SERIES_FORMAT_OVERLAPS.

  • default_series: it cannot be used to clear the default. Sending false for the series that currently is the default answers DEFAULT_CANNOT_BE_UNMARKED, because it would leave the document type with active series and no default, and issuing without an explicit series_id would then fail with SERIES_DEFAULT_NOT_FOUND. Hand the default over with PUT /v1/companies/{company_id}/series/{series_id}/default on the new series, which unmarks the previous one. Sending false for a series that is not the default is a no-op.

Endpoint: PATCH /v1/companies/{company_id}/series/{series_id}

⚠️ Read before calling:

  • Fiscal rules, domains numbering: beel_rules_list with domain, or resource beel://guardrails/.

  • How a series formats numbers, and which series configurations are rejected. (resource: beel://guardrails/series-and-numbering)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
series_idYesSeries ID
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.9.0
    • changedInput schema / $defs / DocumentType / description
      Previous value: -"Document type associated with a series. Values mirror `InvoiceType`,\nso the series a document needs is named exactly like the document:\n- UNASSIGNED: Legacy series, compatible with any invoice type\n- STANDARD: Standard invoice\n- SIMPLIFIED: Simplified invoice\n- CORRECTIVE: Corrects or cancels a previous invoice\n- PROFORMA: Proforma (commercial document, non-fiscal numbering)\n"New value: +"Document type associated with a series. Values mirror `InvoiceType`,\nso the series a document needs is named exactly like the document:\n- UNASSIGNED: Legacy value of series created before types existed. A series numbers only\n  documents of its own type, so an `UNASSIGNED` series numbers none\n  (`422 SERIES_INCOMPATIBLE_DOC_TYPE`); give it a type to keep using it. No series can be\n  created with it or moved to it (`422 SERIES_UNASSIGNED_TYPE_NOT_ALLOWED`). The live\n  ones were given the type they numbered most.\n- STANDARD: Standard invoice\n- SIMPLIFIED: Simplified invoice\n- CORRECTIVE: Corrects or cancels a previous invoice\n- PROFORMA: Proforma (commercial document, non-fiscal numbering)\n"
    • changedInput schema / $defs / PatchSeriesRequest / description
      Previous value: -"Partial update of an invoice series (RFC 5789). Only the fields present in the\nbody are touched:\n\n- **field omitted** → the current value is kept;\n- **field sent with a value** → replaced;\n- **field sent as `null`** → cleared (only `description`, the one field a series\n  can live without).\n\nThe same rules as `PUT` apply: the fields that drive numbering (`code`, `format`,\n`counter_reset`, `initial_number`) are rejected once the series has issued\ninvoices, so renaming a series in production keeps working.\n"New value: +"Partial update of an invoice series (RFC 5789). Only the fields present in the\nbody are touched:\n\n- **field omitted** → the current value is kept;\n- **field sent with a value** → replaced;\n- **field sent as `null`** → cleared (only `description`, the one field a series\n  can live without).\n\nThe same rules as `PUT` apply: the fields that drive numbering (`code`, `format`,\n`counter_reset`, `initial_number`) and `document_type` are rejected once the series has\nissued invoices (`document_type` can still be set on an `UNASSIGNED` series), so renaming a\nseries in production keeps working.\nMoving a series to `document_type: UNASSIGNED` is rejected with\n`422 SERIES_UNASSIGNED_TYPE_NOT_ALLOWED`; a series that already is `UNASSIGNED` can be\nedited without changing its type.\n"
    • changedInput schema / $defs / PatchSeriesRequest / properties / initial_number / description
      Previous value: -"Initial number for this series counter.\nOnly while the series has no issued invoices.\n"New value: +"Initial number for this series counter.\nOnly while the series has no issued invoices.\nIt applies only to the first period in which the series issues an invoice: with\n`counter_reset: ANNUAL` or `MONTHLY`, every later year or month starts at 1. With\n`NEVER` there is a single period, so numbering simply continues from it.\n"
    • changedInput schema / $defs / SeriesFormat / description
      Previous value: -"Format template with available variables (UPPERCASE ONLY):\n- {CODIGO}: Series code (e.g., \"FAC\")\n- {YYYY}: Year with 4 digits (e.g., \"2025\")\n- {YY}: Year with 2 digits (e.g., \"25\")\n- {MM}: Month with 2 digits (e.g., \"01\")\n- {NUM}: Sequential number without padding (e.g., \"1\")\n- {NUM:X}: Sequential number with padding (e.g., {NUM:4} → \"0001\")\n\n**REQUIRED**: Must contain at least {NUM} or {NUM:X}\n**IMPORTANT**: Only uppercase (rejects {yy}, {mm}, {codigo}, etc.)\n\nValid examples:\n- \"{CODIGO}-{YYYY}-{NUM:4}\" → \"FAC-2025-0001\"\n- \"{CODIGO}/{NUM:6}\" → \"FAC/000001\"\n- \"{YYYY}{MM}-{NUM:3}\" → \"202501-001\"\n"New value: +"Format template with available variables (UPPERCASE ONLY):\n- {CODIGO}: Series code (e.g., \"FAC\")\n- {YYYY}: Year with 4 digits (e.g., \"2025\")\n- {YY}: Year with 2 digits (e.g., \"25\")\n- {MM}: Month with 2 digits (e.g., \"01\")\n- {NUM}: Sequential number without padding (e.g., \"1\")\n- {NUM:X}: Sequential number with padding (e.g., {NUM:4} → \"0001\")\n\n**REQUIRED**: Must contain at least {NUM} or {NUM:X}\n**IMPORTANT**: Only uppercase (rejects {yy}, {mm}, {codigo}, etc.)\n\nValid examples:\n- \"{CODIGO}-{YYYY}-{NUM:4}\" → \"FAC-2025-0001\"\n- \"{CODIGO}/{NUM:6}\" → \"FAC/000001\"\n- \"{YYYY}{MM}-{NUM:3}\" → \"202501-001\"\n\nThe generated number is the invoice number sent to the AEAT, which accepts at most 60\nprintable ASCII characters and none of `\"`, `'`, `<`, `>`, `=`. A format whose longest\npossible number breaks that rule is rejected with `422 SERIES_FORMAT_NUMBER_TOO_LONG` or\n`SERIES_FORMAT_INVALID_CHARACTERS`. The counter counts as at least 9 digits, with or without\npadding: `{NUM:X}` is a minimum width, not a maximum.\n"
  2. Changed9 schema fields changedv0.5.0
    • addedInput schema / $defs / PatchSeriesRequest / additionalProperties
      Added value: +false
    • removedInput schema / $defs / PatchSeriesRequest / properties / description / example
      Removed value: -"Series for standard invoices"
    • removedInput schema / $defs / PatchSeriesRequest / properties / initial_number / example
      Removed value: -54
    • removedInput schema / $defs / PatchSeriesRequest / properties / name / example
      Removed value: -"Main Series"
    • removedInput schema / $defs / SeriesCode / example
      Removed value: -"FAC"
    • removedInput schema / $defs / SeriesFormat / example
      Removed value: -"{CODIGO}-{YYYY}-{NUM:4}"
    • 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.5/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that null clears only `description`, that numbering fields are locked after invoices are issued, the 409 SERIES_FORMAT_OVERLAPS overlap rule, and the DEFAULT_CANNOT_BE_UNMARKED outcome with its downstream SERIES_DEFAULT_NOT_FOUND failure. Annotations only say non-read-only, non-idempotent, non-destructive; the description supplies the real behavioral constraints.

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?

Bulleted structure is front-loaded with the partial-update rule and each bullet covers a distinct constraint, though the default_series bullet restates several error paths somewhat discursively. The 'Read before calling' block is a compact, useful pointer rather than filler.

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-required-parameter mutation with no output schema, the description covers preconditions, error codes, the endpoint, and cross-resource references thoroughly. It does not say what the PATCH returns, a minor gap given no output schema is published.

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% and the body schema is already rich, but the description adds semantics the schema does not carry, notably the default_series unmarking failure mode and the cross-series uniqueness rule for code/format/document_type. That is meaningful value on top of an already-detailed schema.

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 precise verb and resource ('Updates only the fields present in the body, leaving every other field of the series as it is'), which pins down both the operation and its partial-update scope. It is distinguishable from siblings like beel_create_series, beel_delete_series and beel_set_default_series, the last of which it explicitly routes away from.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear conditions for when edits are rejected (numbering_locked, overlap conflicts) and an explicit alternative path for default handoff via PUT /series/{id}/default. It lacks a direct statement of when to prefer this PATCH over a full PUT on the series resource, which keeps it short of a 5.

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