Skip to main content
Glama
mcp-facturacion-electronica-es

mcp-facturacion-electronica-es

Es Generate Facturae Xml

es__generate_facturae_xml

Generates an unsigned Facturae 3.2.2 XML invoice for B2G submission to FACe, with optional IVA/IGIC/IPSI, IRPF, and equivalence surcharge data. Sign the resulting XML separately before filing.

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.

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": {
      "invoice": "<invoice>"
    },
    "name": "es__generate_facturae_xml"
  }
}

Input 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_typeNoEM (proveedor, emite el vendedor), RE (destinatario, emite el comprador), TE (tercero). 'EU' se acepta como alias de 'EM'. Por defecto: 'EM'.EM
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

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.11.0
    • changedInput schema / properties / invoice_issuer_type / default
      Previous value: -"EU"New value: +"EM"
    • changedInput schema / properties / invoice_issuer_type / description
      Previous value: -"EU (emisor=vendedor), EM (emisor=comprador),\nTE (tercero). Por defecto: 'EU'."New value: +"EM (proveedor, emite el vendedor), RE (destinatario,\nemite el comprador), TE (tercero). 'EU' se acepta como alias de 'EM'.\nPor defecto: 'EM'."
  2. 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"
      +}
  3. 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"
      +}
  4. First observedv0.0.1

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden; it does add one important behavioral fact — the produced document is unsigned and must be signed before use. It does not say whether a file is written to disk or only a string/filename is returned, nor any side effects or error behavior, leaving meaningful gaps for a generator tool.

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 short sentences, front-loaded with the generation purpose and immediately followed by the critical unsigned-document caveat and next step. Nothing is redundant.

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

Completeness3/5

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

For a 10-parameter tool with a nested invoice object, the description is minimal but the schema and output schema cover the details. It omits prerequisite context useful for the stated B2G/FACe scenario, such as the need for resolution_reference and validation before signing/submission.

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?

Schema description coverage is 100%, so all ten parameters (including tax_type regimes, IRPF withholding, recargo de equivalencia, invoice_issuer_type and resolution_reference) are already documented in the schema. The description adds no parameter-level meaning beyond that, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Genera una factura XML') and pins the standard and target ('Facturae 3.2.2', 'envío B2G al portal FACe'), which separates it from B2B e-invoice siblings. It does not explicitly contrast with es__generate_b2b_einvoice_es, so differentiation is partial rather than complete.

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 usage context (B2G delivery to FACe) and names the mandatory follow-up tool es__sign_facturae_xades because the output is unsigned. No exclusions or mention of validation (es__validate_facturae_schema) or submission (es__submit_to_face) stages are given.

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