Skip to main content
Glama
cmendezs

mcp-facturacion-electronica-es

Es Generate Facturae Xml

es__generate_facturae_xml

Generates a Facturae 3.2.2 XML invoice for B2G submission to the Spanish FACe portal. Produces an unsigned document ready for XAdES signing.

Instructions

Genera una factura XML conforme a Facturae 3.2.2 para envío B2G al portal FACe.

El documento generado está sin firmar; use es__sign_facturae_xades para firmarlo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceYesInvoiceDocument con seller, buyer, vat_summary y lines.
tax_typeNoImpuesto indirecto aplicable a todas las líneas de la factura (IVA: península/Baleares; IPSI: Ceuta/Melilla; IGIC: Canarias). No se admite mezclar impuestos en una misma factura. Por defecto: 'IVA'.IVA
irpf_rateNoTipo de retención IRPF (%), emitido en TaxesWithheld.
irpf_amountNoImporte de retención IRPF a deducir del total de la factura.
schema_versionNoVersión del esquema Facturae (por defecto: '3.2.2').3.2.2
invoice_issuer_typeNoEU (emisor=vendedor), EM (emisor=comprador), TE (tercero). Por defecto: 'EU'.EU
resolution_referenceNoResolutionReference para facturas B2G a Administraciones Públicas.
recargo_equivalencia_rateNoTipo de Recargo de Equivalencia (%), si aplica.
recargo_equivalencia_amountNoImporte explícito del Recargo de Equivalencia. Si se omite, se calcula como base_imponible * recargo_equivalencia_rate / 100.
receiver_transaction_referenceNoReceiverTransactionReference para facturas B2G.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed28 schema fields changedv0.8.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / invoice / additionalProperties
      Added value: +true
    • changedInput schema / properties / invoice_issuer_type / description
      Previous value: -"EU (emisor=vendedor), EM (emisor=comprador), TE (tercero). Por defecto: 'EU'."New value: +"EU (emisor=vendedor), EM (emisor=comprador),\nTE (tercero). Por defecto: 'EU'."
    • removedInput schema / properties / invoice_issuer_type / enum
      Removed value: -[
      -  "EU",
      -  "EM",
      -  "TE"
      -]
    • addedInput schema / properties / irpf_amount / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / irpf_amount / default
      Added value: +null
    • removedInput schema / properties / irpf_amount / type
      Removed value: -"number"
    • addedInput schema / properties / irpf_rate / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / irpf_rate / default
      Added value: +null
    • removedInput schema / properties / irpf_rate / type
      Removed value: -"number"
    • addedInput schema / properties / recargo_equivalencia_amount / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / recargo_equivalencia_amount / default
      Added value: +null
    • changedInput schema / properties / recargo_equivalencia_amount / description
      Previous value: -"Importe explícito del Recargo de Equivalencia. Si se omite, se calcula como base_imponible * recargo_equivalencia_rate / 100."New value: +"Importe explícito del Recargo de Equivalencia.\nSi se omite, se calcula como base_imponible * recargo_equivalencia_rate / 100."
    • removedInput schema / properties / recargo_equivalencia_amount / type
      Removed value: -"number"
    • addedInput schema / properties / recargo_equivalencia_rate / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / recargo_equivalencia_rate / default
      Added value: +null
    • removedInput schema / properties / recargo_equivalencia_rate / type
      Removed value: -"number"
    • addedInput schema / properties / receiver_transaction_reference / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / receiver_transaction_reference / default
      Added value: +null
    • changedInput schema / properties / receiver_transaction_reference / description
      Previous value: -"ReceiverTransactionReference para facturas B2G."New value: +"ReceiverTransactionReference para\nfacturas B2G."
    • removedInput schema / properties / receiver_transaction_reference / type
      Removed value: -"string"
    • addedInput schema / properties / resolution_reference / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / resolution_reference / default
      Added value: +null
    • changedInput schema / properties / resolution_reference / description
      Previous value: -"ResolutionReference para facturas B2G a Administraciones Públicas."New value: +"ResolutionReference para facturas B2G a\nAdministraciones Públicas."
    • removedInput schema / properties / resolution_reference / type
      Removed value: -"string"
    • changedInput schema / properties / tax_type / description
      Previous value: -"Impuesto indirecto aplicable a todas las líneas de la factura (IVA: península/Baleares; IPSI: Ceuta/Melilla; IGIC: Canarias). No se admite mezclar impuestos en una misma factura. Por defecto: 'IVA'."New value: +"Impuesto indirecto aplicable a todas las líneas de la factura\n(IVA: península/Baleares; IPSI: Ceuta/Melilla; IGIC: Canarias).\nNo se admite mezclar impuestos en una misma factura. Por defecto: 'IVA'."
    • removedInput schema / properties / tax_type / enum
      Removed value: -[
      -  "IVA",
      -  "IPSI",
      -  "IGIC"
      -]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  2. Changed8 schema fields changedv0.7.0
    • addedInput schema / properties / invoice_issuer_type
      Added value: +{
      +  "default": "EU",
      +  "description": "EU (emisor=vendedor), EM (emisor=comprador), TE (tercero). Por defecto: 'EU'.",
      +  "enum": [
      +    "EU",
      +    "EM",
      +    "TE"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / irpf_amount
      Added value: +{
      +  "description": "Importe de retención IRPF a deducir del total de la factura.",
      +  "type": "number"
      +}
    • addedInput schema / properties / irpf_rate
      Added value: +{
      +  "description": "Tipo de retención IRPF (%), emitido en TaxesWithheld.",
      +  "type": "number"
      +}
    • addedInput schema / properties / recargo_equivalencia_amount
      Added value: +{
      +  "description": "Importe explícito del Recargo de Equivalencia. Si se omite, se calcula como base_imponible * recargo_equivalencia_rate / 100.",
      +  "type": "number"
      +}
    • addedInput schema / properties / recargo_equivalencia_rate
      Added value: +{
      +  "description": "Tipo de Recargo de Equivalencia (%), si aplica.",
      +  "type": "number"
      +}
    • addedInput schema / properties / receiver_transaction_reference
      Added value: +{
      +  "description": "ReceiverTransactionReference para facturas B2G.",
      +  "type": "string"
      +}
    • addedInput schema / properties / resolution_reference
      Added value: +{
      +  "description": "ResolutionReference para facturas B2G a Administraciones Públicas.",
      +  "type": "string"
      +}
    • addedInput schema / properties / tax_type
      Added value: +{
      +  "default": "IVA",
      +  "description": "Impuesto indirecto aplicable a todas las líneas de la factura (IVA: península/Baleares; IPSI: Ceuta/Melilla; IGIC: Canarias). No se admite mezclar impuestos en una misma factura. Por defecto: 'IVA'.",
      +  "enum": [
      +    "IVA",
      +    "IPSI",
      +    "IGIC"
      +  ],
      +  "type": "string"
      +}
  3. First observedv0.0.1

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full transparency burden. It does disclose the most important behavioral trait—the generated document is unsigned and requires a separate signing step. However, it does not address whether any state changes, permissions, or side effects exist beyond that.

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?

Two sentences with zero waste: the first explains what is generated and for whom, the second provides the critical caveat and next-step tool. Essential information is front-loaded.

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 rich input schema, the output schema, and the clear naming of the signing tool, the description provides enough context for correct invocation. It could also have pointed to es__submit_to_face as the final B2G submission step, but the signing step is enough as the immediate next action.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, so each parameter already carries semantic meaning (e.g., tax_type distinguishes IVA/IGIC/IPSI, irpf_rate, recargo_equivalencia). The main description adds little parameter-level detail, so a baseline 3 is appropriate.

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 specific verb and deliverable: generates a Facturae 3.2.2 XML for B2G submission to the FACe portal. This clearly distinguishes it from B2B, Verifactu, and SII sibling tools.

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?

The description explicitly says the XML is for B2G/FACe and names es__sign_facturae_xades as the next step, giving the agent a direct call chain. It does not explicitly list when not to use it, but the B2G/FACe and unsigned-signing guidance is enough to disambiguate from the other siblings.

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