Skip to main content
Glama
cmendezs

mcp-facturacion-electronica-es

Es Generate Verifactu Record

es__generate_verifactu_record

Generate a VERI*FACTU invoice record with SHA-256 hash chain for Spanish electronic billing compliance, returning XML and hash to link with the next record.

Instructions

Genera un registro de factura VERI*FACTU (Orden HAC/1177/2024) con cadena SHA-256 Huella.

Devuelve el XML del registro y la Huella para encadenar con el siguiente registro. Llame a es__detect_regional_regime antes para confirmar que el régimen es VERIFACTU.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceYesDatos de la factura (date, number, seller, buyer, vat_summary, note).
impuestoNoCódigo de impuesto (por defecto '01' IVA).01
software_idYesIDSistemaInformatico del software certificado.
invoice_typeNoTipoFactura según HAC/1177/2024 Annex I (F1, F2, F3, R1, R2, R3, R4, R5).F1
software_nifYesNIF del fabricante del software.
clave_regimenNoClaveRegimenEspecialOTrascendencia (por defecto '01').01
previous_hashNoHuella SHA-256 del registro precedente (omitir para el primero).
previous_fechaNoFechaExpedicionFactura del registro anterior en DD-MM-YYYY (requerido si previous_hash está presente).
previous_num_serieNoNumSerieFactura del registro anterior (requerido si previous_hash está presente).
previous_emisor_nifNoNIF del emisor del registro anterior (requerido si previous_hash está presente).
calificacion_operacionNoCalificacionOperacion (por defecto 'S1').S1

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed26 schema fields changedv0.8.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / calificacion_operacion
      Added value: +{
      +  "default": "S1",
      +  "description": "CalificacionOperacion (por defecto 'S1').",
      +  "type": "string"
      +}
    • addedInput schema / properties / clave_regimen
      Added value: +{
      +  "default": "01",
      +  "description": "ClaveRegimenEspecialOTrascendencia (por defecto '01').",
      +  "type": "string"
      +}
    • addedInput schema / properties / impuesto
      Added value: +{
      +  "default": "01",
      +  "description": "Código de impuesto (por defecto '01' IVA).",
      +  "type": "string"
      +}
    • addedInput schema / properties / invoice / additionalProperties
      Added value: +true
    • addedInput schema / properties / invoice_type / default
      Added value: +"F1"
    • changedInput schema / properties / invoice_type / description
      Previous value: -"TipoFactura según HAC/1177/2024 Annex I."New value: +"TipoFactura según HAC/1177/2024 Annex I\n(F1, F2, F3, R1, R2, R3, R4, R5)."
    • removedInput schema / properties / invoice_type / enum
      Removed value: -[
      -  "F1",
      -  "F2",
      -  "F3",
      -  "R1",
      -  "R2",
      -  "R3",
      -  "R4",
      -  "R5"
      -]
    • addedInput schema / properties / previous_emisor_nif / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / previous_emisor_nif / default
      Added value: +null
    • changedInput schema / properties / previous_emisor_nif / description
      Previous value: -"NIF del emisor del registro anterior (requerido si previous_hash está presente)."New value: +"NIF del emisor del registro anterior (requerido si\nprevious_hash está presente)."
    • removedInput schema / properties / previous_emisor_nif / type
      Removed value: -"string"
    • addedInput schema / properties / previous_fecha / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / previous_fecha / default
      Added value: +null
    • changedInput schema / properties / previous_fecha / description
      Previous value: -"FechaExpedicionFactura del registro anterior en DD-MM-YYYY (requerido si previous_hash está presente)."New value: +"FechaExpedicionFactura del registro anterior en DD-MM-YYYY\n(requerido si previous_hash está presente)."
    • removedInput schema / properties / previous_fecha / type
      Removed value: -"string"
    • addedInput schema / properties / previous_hash / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / previous_hash / default
      Added value: +null
    • changedInput schema / properties / previous_hash / description
      Previous value: -"Huella SHA-256 del registro precedente (omitir o null para el primero)."New value: +"Huella SHA-256 del registro precedente (omitir para el primero)."
    • removedInput schema / properties / previous_hash / type
      Removed value: -"string"
    • addedInput schema / properties / previous_num_serie / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / previous_num_serie / default
      Added value: +null
    • changedInput schema / properties / previous_num_serie / description
      Previous value: -"NumSerieFactura del registro anterior (requerido si previous_hash está presente)."New value: +"NumSerieFactura del registro anterior (requerido si\nprevious_hash está presente)."
    • removedInput schema / properties / previous_num_serie / type
      Removed value: -"string"
    • changedInput schema / required
      Previous value: -[
      -  "invoice",
      -  "software_id",
      -  "software_nif",
      -  "invoice_type"
      -]New value: +[
      +  "invoice",
      +  "software_id",
      +  "software_nif"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  2. Changed3 schema fields changedv0.2.0
    • addedInput schema / properties / previous_emisor_nif
      Added value: +{
      +  "description": "NIF del emisor del registro anterior (requerido si previous_hash está presente).",
      +  "type": "string"
      +}
    • addedInput schema / properties / previous_fecha
      Added value: +{
      +  "description": "FechaExpedicionFactura del registro anterior en DD-MM-YYYY (requerido si previous_hash está presente).",
      +  "type": "string"
      +}
    • addedInput schema / properties / previous_num_serie
      Added value: +{
      +  "description": "NumSerieFactura del registro anterior (requerido si previous_hash está presente).",
      +  "type": "string"
      +}
  3. First observedv0.0.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the core behavior: generating a record, returning XML and a fingerprint for chaining, and notes the prerequisite check. It doesn't mention side effects or error conditions, but for a generation tool these are not critical and the output schema covers return details.

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 description is three sentences, each earning its place: the main action, the output, and a prerequisite call. It is front-loaded with the most important information and contains no fluff.

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?

Given the tool's complexity (11 parameters, nested invoice object, output schema), the description covers the essential aspects: what it generates, what it returns, and the prerequisite check. The output schema and parameter schema handle detailed field documentation, so nothing critical is missing.

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 description coverage is 100%, so the baseline is 3. The description adds value by explaining the chaining concept ('encadenar con el siguiente registro'), which clarifies the purpose of the previous_* parameters. It also contextualizes the Huella, aiding understanding of the hash parameter.

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 clearly states the tool generates a VERI*FACTU invoice record with SHA-256 chaining, referencing the specific regulation. It mentions returning XML and the fingerprint, distinguishing it from validation, submission, and cancellation siblings by focusing on generation.

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 explicitly instructs calling es__detect_regional_regime first to confirm the regime is VERIFACTU, which is a clear precondition. It does not explicitly name alternative tools for other regimes, but the specificity to VERI*FACTU and the prerequisite make the usage context clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.