Skip to main content
Glama
BeeL MCP server

BeeL MCP server

Official
by beel-es

beel_patch_series

Destructive

Update only the fields provided in an invoice series, keeping all other settings unchanged and preserving numbering rules for issued invoices.

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.

BeeL API endpoint: PATCH /v1/companies/{company_id}/series/{series_id} (reference: https://docs.beel.es)

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

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "company_id": "<company_id>",
      "series_id": "<series_id>",
      "body": "<body>"
    },
    "name": "beel_patch_series"
  }
}

Input 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.10.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 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"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 standard invoice (R1–R4)\n- SIMPLIFIED_CORRECTIVE: Corrects a simplified invoice (R5). Spanish law requires R5 to be\n  numbered apart from R1–R4, so they have a series type of their own\n- PROFORMA: Proforma (commercial document, non-fiscal numbering)\n"
    • changedInput schema / $defs / DocumentType / enum
      Previous value: -[
      -  "UNASSIGNED",
      -  "STANDARD",
      -  "SIMPLIFIED",
      -  "CORRECTIVE",
      -  "PROFORMA"
      -]New value: +[
      +  "UNASSIGNED",
      +  "STANDARD",
      +  "SIMPLIFIED",
      +  "CORRECTIVE",
      +  "SIMPLIFIED_CORRECTIVE",
      +  "PROFORMA"
      +]
    • addedInput schema / properties / body / type
      Added value: +"object"
    • addedInput schema / properties / series_id / type
      Added value: +"string"
  2. 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"
  3. 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."
  4. 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 idempotentHint=false, and the description goes well beyond them: it discloses that only `description` can be cleared via null, that numbering fields lock after the first issued invoice (`numbering_locked`), that unmarking the default fails with DEFAULT_CANNOT_BE_UNMARKED and cascades to SERIES_DEFAULT_NOT_FOUND, and that `false` on a non-default series is a no-op. Specific error codes plus the field-omitted/valued/null tri-state make the mutation's blast radius legible.

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 core partial-update rule, then bulleted by concern (clearing, numbering lock, overlap, default), which scans well. There is mild duplication with the PatchSeriesRequest schema description of the same tri-state semantics, but the tool-level bullets add error codes and the default-handover path rather than merely restating.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive, nested-body PATCH with no output schema, the description supplies everything an agent needs before calling: partial semantics, locked fields, named rejection codes, the escape hatch for the default flag, and pointers to the guardrail resources for the fiscal rules it delegates. Return shape is unspecified but acceptable since failures are enumerated by code.

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 description compensates by explaining cross-field semantics the schema states only in isolation: which fields are numbering-locked, how `default_series` interacts with `document_type`, and the format-overlap rule for `code`/`format`/`document_type`. Some per-field detail (`name`, `active`) is left entirely to the schema, so it is strong but not exhaustive.

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 precise verb+resource and the defining scope: 'Updates only the fields present in the body, leaving every other field of the series as it is.' That partial-update framing distinguishes it from a full-replacement series update and from the many beel_patch_* siblings that target different resources.

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?

It gives concrete when/when-not guidance: numbering fields are rejected once invoices are issued, overlapping formats are rejected with 409, and default handover must go through the PUT .../default endpoint (the description cites the raw endpoint rather than naming the sibling tool beel_set_default_series). The 'Read before calling' block routes the agent to beel_rules_list and the guardrail resources for fiscal constraints.

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