Skip to main content
Glama
cmendezs

mcp-facturacion-electronica-es

Es Sign Facturae Xades

es__sign_facturae_xades

Sign an unsigned Facturae XML with a XAdES-ES digital signature (SHA-256 + RSA) using a PKCS#12 certificate. Includes a two-step confirmation to review before applying the real signature.

Instructions

Aplica una firma digital XAdES-EPES (ETSI EN 319 132-1) a un documento Facturae XML.

Usa el certificado PKCS#12 indicado para firmar con SHA-256 + RSA. La política de firma por defecto es la de Facturae (Orden EHA/962/2007).

HUMAN-IN-THE-LOOP: llame sin confirmation_token para recibir un resumen de confirmación y un token; muéstrelo al usuario y vuelva a llamar con confirmation_token para aplicar la firma real.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xmlYesXML Facturae sin firmar.
cert_pathNoRuta al certificado PKCS#12 (.p12 / .pfx). La contraseña se lee de AEAT_CERTIFICATE_PASSWORD (nunca como argumento de la tool).
confirmation_tokenNoToken de la respuesta awaiting_confirmation previa.
signature_policy_idNoOID/URI de la política de firma. Por defecto: política Facturae (Orden EHA/962/2007).
signature_policy_hashNoSHA-256 base64 del documento de política de firma.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv0.8.0
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / cert_path / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / cert_path / default
      Added value: +null
    • changedInput schema / properties / cert_path / description
      Previous value: -"Ruta al certificado PKCS#12 (.p12 / .pfx). La contraseña se lee de AEAT_CERTIFICATE_PASSWORD (nunca como argumento de la tool)."New value: +"Ruta al certificado PKCS#12 (.p12 / .pfx). La contraseña se\nlee de AEAT_CERTIFICATE_PASSWORD (nunca como argumento de la tool)."
    • removedInput schema / properties / cert_path / type
      Removed value: -"string"
    • addedInput schema / properties / confirmation_token
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Token de la respuesta awaiting_confirmation previa."
      +}
    • addedInput schema / properties / signature_policy_hash / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / signature_policy_hash / default
      Added value: +null
    • removedInput schema / properties / signature_policy_hash / type
      Removed value: -"string"
    • addedInput schema / properties / signature_policy_id / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / signature_policy_id / default
      Added value: +null
    • changedInput schema / properties / signature_policy_id / description
      Previous value: -"OID/URI de la política de firma. Por defecto: política Facturae (Orden EHA/962/2007)."New value: +"OID/URI de la política de firma. Por defecto:\npolítica Facturae (Orden EHA/962/2007)."
    • removedInput schema / properties / signature_policy_id / type
      Removed value: -"string"
    • changedInput schema / required
      Previous value: -[
      -  "xml",
      -  "cert_path"
      -]New value: +[
      +  "xml"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  2. Changed2 schema fields changedv0.7.0
    • removedInput schema / properties / cert_password
      Removed value: -{
      -  "description": "Contraseña del certificado (omitir si sin protección).",
      -  "type": "string"
      -}
    • changedInput schema / properties / cert_path / description
      Previous value: -"Ruta al certificado PKCS#12 (.p12 / .pfx)."New value: +"Ruta al certificado PKCS#12 (.p12 / .pfx). La contraseña se lee de AEAT_CERTIFICATE_PASSWORD (nunca como argumento de la tool)."
  3. First observedv0.0.1

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It discloses the signing algorithm (SHA-256 + RSA), the default signature policy, and the human-in-the-loop confirmation mechanism. It also clarifies that the certificate password is read from an environment variable and never passed as an argument. This is transparent about the security aspect. It does not mention potential side effects (e.g., whether the input XML is modified or a new file is produced) or error conditions, but for a signing operation the behavior is reasonably well covered.

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?

The description is moderately sized with a clear structure: it states the core purpose, then details the signature process, then the confirmation workflow. The human-in-the-loop instruction is prominent and important. It could be slightly more concise (e.g., merging the certificate path explanation), but the length is justified by the complexity of the confirmation flow.

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 that an output schema exists, the description does not need to explain return values. It covers the required parameters, the default behavior, and the confirmation flow. It does not mention validation of the input XML or potential error handling, but those are likely covered by the schema and the tool's implementation. Overall, an agent has enough information to invoke the tool correctly in the intended two-step manner.

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 100%, so the baseline is 3. The description adds value by explaining the confirmation_token parameter's role in the two-step flow, the default signature policy for signature_policy_id, and that cert_path refers to a PKCS#12 file. These clarifications go beyond the schema's terse descriptions, providing operational context that helps the agent use the parameters correctly.

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?

Description clearly states it applies XAdES-EPES digital signature to a Facturae XML document, using a PKCS#12 certificate. This is specific and distinguishes it from sibling tools that handle generation, validation, or submission. The verb 'Aplica' and the resource 'documento Facturae XML' are explicit.

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 outlines the two-step confirmation workflow: call without confirmation_token to receive a summary, then call with the token to apply the signature. This is clear guidance for the intended usage. It does not explicitly contrast with alternatives, but the sibling tools serve different purposes, so usage context is implied. It could be improved by noting when not to use it (e.g., if only validation is needed).

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