Skip to main content
Glama
BeeL MCP server

BeeL MCP server

Official
by beel-es

beel_activate_compliance_system

DestructiveIdempotent

Activates or schedules a company's VeriFactu, SII, or TicketBAI compliance status from a chosen date with system-specific settings, handling incompatible systems and date rules.

Instructions

Activates system for this company from effective_from on, in the environment of the request, with the settings of that system. It is a fact of the taxpayer: it applies to every invoice issued from that date, never to a single one.

  • Today or later: effective_from today applies the system from now on; a later date schedules it. A date in the past answers 422 COMPLIANCE_EFFECTIVE_DATE_IN_PAST.

  • Changing the settings: activating a system that already applies, with other settings, ends its current period on effective_from and starts a new one. A later date replaces an activation of the same system that is still scheduled.

  • Same body, no change: a body equal to the activation in force or to the scheduled one answers 200 and changes nothing.

  • Systems that exclude each other: VeriFactu, the SII and TicketBAI never apply on the same day. Activating one ends the one that applies on effective_from, in the same call, and the response shows how the company is left. When that is not possible, the request answers 422 COMPLIANCE_SYSTEMS_INCOMPATIBLE and nothing changes.

  • VeriFactu: activating VERIFACTU behaves like turning VeriFactu on with PUT /v1/companies/{company_id}/verifactu-configuration, with the same errors. That resource stays available and reports the same state. VeriFactu has no settings. In Live, the signed and validated AEAT representation is required and the NIF is registered for VeriFactu submission at the time of the call, also when effective_from is a later date.

  • SII: settings.periodicity and settings.reason are required, and acknowledge_responsibility must be true. Activating it registers the NIF of the company for SII submission, so it needs a NIF, as VeriFactu does. The option for the SII must be in force in the AEAT tax census by effective_from: otherwise the AEAT rejects the submissions.

  • SII in Live: the account needs the SII contracted, and every change of the SII takes effect tomorrow at the earliest: entering it, leaving it (also by activating VERIFACTU while the SII applies) and changing settings.reason or settings.periodicity. Without sii_exit, leaving the SII never takes effect on a past date. The company enters the SII on 1 January, unless it declares with settings.already_in_sii that it is already in the SII: then it can enter on any date. Once in the SII, it can only be left from 1 January when settings.reason is VOLUNTARY or MANDATORY_LARGE_COMPANY, from the first day of a month when it is REDEME, and on any date when it is VAT_GROUP. Changing settings.periodicity of the SII in force takes effect on 1 January, so it is scheduled before that day. Moving from VOLUNTARY to another reason keeps the company in the SII and is accepted on any date from tomorrow. Any other change of settings.reason ends the period in force, so it follows the rule for leaving under the reason of that period.

  • SII in Sandbox: no contract is needed, and the company can enter and leave the SII and change its settings on any date from today.

  • TicketBAI: available in Sandbox only; in Live it answers 422 COMPLIANCE_SYSTEM_NOT_AVAILABLE. settings.territory is required, and it has to be the provincial tax authority of the fiscal address of the company, determined from its postal code: Álava (01), Bizkaia (48) or Gipuzkoa (20). Otherwise the request answers 422 TICKETBAI_TERRITORY_MISMATCH, also when the company has no postal code or its fiscal address is outside Spain. What decides is whether the foral rules of that territory govern the company's personal income tax (IRPF), corporate income tax (IS) or, for a permanent establishment, non-resident income tax (IRNR), and that can hold with a fiscal address registered elsewhere: for example, a self-employed person whose habitual residence is in the Basque Country, or a company domiciled elsewhere in Spain whose volume of operations exceeded 12 million euros the previous year, 75% or more of it in the Basque Country. Then send settings.territory_confirmed as true, and the fiscal address is not checked. In Bizkaia, settings.lroe_model is required, and so is settings.activity_code with the model "140". acknowledge_responsibility is ignored.

With VERIFACTU, sii_exit permits a past date after a REDEME exclusion or VAT group cessation. effective_from must be the first day of the notification month for REDEME, or the cessation date for a VAT group. The company confirms that no other cause of monthly VAT returns remains. Valid evidence is required in Live and Sandbox. BeeL keeps existing SII obligations and their evidence, without retrospective VeriFactu registrations or changes to original PDFs. Pending submissions continue; rejected ones remain available for individual correction and are excluded from the company retry batch outside the legal SII period. New invoices use their own fiscal date. Exchanging an original SII simplified invoice remains limited by SIMPLIFIED_EXCHANGE_NOT_RECORDABLE. As a conservative product safeguard, BeeL rejects an exit spanning any issued invoice at or after the applicable mandatory invoicing-system deadline.

Order of the rules

The rules are checked in this order, and the first one that fails answers; nothing is changed:

  1. The request: VALIDATION_ERROR, IDEMPOTENCY_KEY_REQUIRED.

  2. Access to the company: 403.

  3. Evidence destination, confirmation and dates: VALIDATION_ERROR, SII_EXIT_CONFIRMATION_REQUIRED, SII_EXIT_DATE_MISMATCH; then an equal activation answers 200 without rewriting evidence.

  4. The system in the environment: COMPLIANCE_SYSTEM_NOT_AVAILABLE; with SII in Live, SII_NOT_CONTRACTED and then 402.

  5. The settings and the territory: SII_ACKNOWLEDGEMENT_REQUIRED, SII_QUARTERLY_REQUIRES_VOLUNTARY, SII_TERRITORY_NOT_SUPPORTED, TICKETBAI_TERRITORY_MISMATCH.

  6. The dates: COMPLIANCE_EFFECTIVE_DATE_IN_PAST, SII_CHANGE_ONLY_FROM_TOMORROW, SII_ENTRY_ONLY_FROM_JANUARY_FIRST, SII_EXIT_ONLY_FROM_JANUARY_FIRST, SII_EXIT_ONLY_FROM_MONTH_START, SII_PERIODICITY_CHANGE_ONLY_FROM_JANUARY_FIRST, COMPLIANCE_SYSTEMS_INCOMPATIBLE.

  7. With sii_exit, compatible history and issued invoices: SII_EXIT_CAUSE_MISMATCH, SII_EXIT_SPANS_VERIFACTU_DEADLINE. With VERIFACTU in Live: VERIFACTU_REPRESENTATION_REQUIRED.

  8. The registration of the NIF: COMPANY_NIF_MISSING, API_COMMUNICATION_ERROR.

PUT /v1/companies/{company_id}/verifactu-configuration with enabled: true is this operation with VERIFACTU and effective_from today, in the same order.

The response carries the same body as GET /v1/companies/{company_id}/compliance.

BeeL API endpoint: POST /v1/companies/{company_id}/compliance/systems/{system}/activate (reference: https://docs.beel.es)

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>",
      "system": "<system>",
      "body": "<body>"
    },
    "name": "beel_activate_compliance_system"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYes
systemYesThe compliance system the operation acts on. A value that is not listed answers `400 VALIDATION_ERROR`.
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.
idempotency_keyNoOptional idempotency key for this operation. Omit it and one is derived from the request itself, which makes a blind retry safe but also collapses a SECOND, deliberately identical operation into the first for 24 hours. Set it — to an order id, or anything unique per intended operation — whenever you mean to create something that may look identical to what you just created.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.12.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and idempotentHint=true, and the description substantiates and extends that: it explains that activating one system ends an incompatible one in the same call, that existing SII obligations and evidence are preserved, that rejected submissions are excluded from retry, and that a conservative safeguard blocks exits spanning invoices past the deadline. It enumerates the error codes in evaluation order, which no annotation conveys.

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?

Structure is strong: the core statement leads, then bullets per system and a numbered rule-order section. It is however very long, with some redundancy against the schema (acknowledge_responsibility, effective_from past-date rules, TicketBAI territory matching are all repeated), so not every sentence earns its place.

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, multi-system mutation with nested settings and no output schema, the definition supplies prerequisites (NIF registration, SII contract, AEAT census, representation in Live), date constraints, incompatibility handling, and states the response body equals GET /v1/companies/{company_id}/compliance. Nothing material is left for the agent to infer.

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 high (75%) and the nested definitions are already detailed, so much of the settings/territory text restates the schema. The description nonetheless adds real meaning the schema does not: when settings are ignored (TicketBAI ignores acknowledge_responsibility), the interplay of sii_exit with VERIFACTU and past dates, and the fact that a body equal to the activation in force rewrites nothing.

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 first sentence states the exact verb (activates), resource (a compliance system), scope (per company, from effective_from, in the request's environment, with its settings) and clarifies the semantics: it is a taxpayer-level fact applying to every invoice, not a single one. This distinguishes it from the sibling beel_deactivate_compliance_system and from per-invoice operations without needing to open any schema.

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 covers when each system applies, when a request is rejected (past dates, incompatible system combinations, TicketBAI in Live), and how it relates to an alternative endpoint (PUT /v1/companies/{company_id}/verifactu-configuration is stated to be this operation with VERIFACTU and today's date). It also states the no-op case (identical body returns 200) and the ordering of rule evaluation, so an agent knows exactly which failure to expect.

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