Skip to main content
Glama

specgrid-eu-compliance

AEAT VeriFactu SHA-256 Fingerprint & QR

verifactu_fingerprint
Read-onlyIdempotent

Compute a single Spanish AEAT VeriFactu (RD 1007/2023 & Orden HAC/1177/2024) 8-field canonical UTF-8 string, 64-char uppercase SHA-256 Huella, official ValidarQR URL, and print-ready framed SVG QR. Stateless, deterministic, read-only with zero data retention; returns canonicalPayload, fingerprintSha256, qrValidationUrl, qrSvg, and optional nifWarning (returns isError=true if date/timestamp/hash format is invalid). Use when signing one invoice record or chaining onto a known previousHash; use verifactu_verify_chain to audit multiple historical records, or einvoice_generate to emit full sf:RegistroAlta XML.

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": {
      "issuerNif": "<issuerNif>",
      "seriesNumber": "<seriesNumber>",
      "issueDate": "<issueDate>",
      "invoiceType": "<invoiceType>",
      "taxAmount": "<taxAmount>",
      "totalAmount": "<totalAmount>",
      "generationTimestamp": "<generationTimestamp>"
    },
    "name": "verifactu_fingerprint"
  }
}

Input Schema

NameRequiredDescriptionDefault
issueDateYesInvoice issue date (FechaExpedicionFactura) in strict DD-MM-YYYY format (e.g. "29-11-2026").
issuerNifYesSpanish issuer tax ID (NIF/DNI/NIE/CIF without spaces, e.g. "89890001K" or "B85905495").
taxAmountYesTotal VAT/tax quota (CuotaTotal) as decimal number; normalized to 2 decimal places with dot separator (e.g. 21.00).
environmentNoAEAT QR validation host: "production" (www2.agenciatributaria.gob.es) or "sandbox" (prewww2.aeat.es).production
invoiceTypeYesOfficial AEAT TipoFactura code: F1 standard, F2 simplified, F3 replacement, R1-R5 rectifying invoices.
totalAmountYesTotal gross invoice amount including taxes (ImporteTotal); normalized to 2 decimal places (e.g. 121.00).
previousHashNoPrevious invoice 64-char uppercase hex SHA-256 Huella, or empty string "" for the first invoice in a series.
seriesNumberYesInvoice series and sequential number (NumSerieFactura, max 60 chars, e.g. "INV-2026/0001").
verifactuModeNoTrue for VERI*FACTU mode (ValidarQR endpoint + "VERI*FACTU" caption); false for No-VERI*FACTU mode (ValidarQRNoVerifactu).
generationTimestampYesExact record generation timestamp (FechaHoraHusoGenRegistro) in ISO-8601 format with timezone offset (e.g. "2026-11-29T12:00:00+01:00").

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / environment / description
      Added value: +"AEAT QR validation host: \"production\" (www2.agenciatributaria.gob.es) or \"sandbox\" (prewww2.aeat.es)."
    • changedInput schema / properties / generationTimestamp / description
      Previous value: -"ISO-8601 timestamp with timezone offset (e.g. 2026-11-29T12:00:00+01:00)"New value: +"Exact record generation timestamp (FechaHoraHusoGenRegistro) in ISO-8601 format with timezone offset (e.g. \"2026-11-29T12:00:00+01:00\")."
    • addedInput schema / properties / invoiceType / description
      Added value: +"Official AEAT TipoFactura code: F1 standard, F2 simplified, F3 replacement, R1-R5 rectifying invoices."
    • changedInput schema / properties / issueDate / description
      Previous value: -"Issue date in strict DD-MM-YYYY format"New value: +"Invoice issue date (FechaExpedicionFactura) in strict DD-MM-YYYY format (e.g. \"29-11-2026\")."
    • changedInput schema / properties / issuerNif / description
      Previous value: -"Spanish NIF/CIF of issuer (e.g. 89890001K or B85905495)"New value: +"Spanish issuer tax ID (NIF/DNI/NIE/CIF without spaces, e.g. \"89890001K\" or \"B85905495\")."
    • addedInput schema / properties / previousHash / default
      Added value: +""
    • changedInput schema / properties / previousHash / description
      Previous value: -"Previous 64-char SHA-256 Huella, or empty string for first record"New value: +"Previous invoice 64-char uppercase hex SHA-256 Huella, or empty string \"\" for the first invoice in a series."
    • changedInput schema / properties / seriesNumber / description
      Previous value: -"Invoice series and number (e.g. INV-2026/0001)"New value: +"Invoice series and sequential number (NumSerieFactura, max 60 chars, e.g. \"INV-2026/0001\")."
    • changedInput schema / properties / taxAmount / description
      Previous value: -"Total VAT/tax amount (CuotaTotal)"New value: +"Total VAT/tax quota (CuotaTotal) as decimal number; normalized to 2 decimal places with dot separator (e.g. 21.00)."
    • changedInput schema / properties / totalAmount / description
      Previous value: -"Gross invoice total (ImporteTotal)"New value: +"Total gross invoice amount including taxes (ImporteTotal); normalized to 2 decimal places (e.g. 121.00)."
    • addedInput schema / properties / verifactuMode / description
      Added value: +"True for VERI*FACTU mode (ValidarQR endpoint + \"VERI*FACTU\" caption); false for No-VERI*FACTU mode (ValidarQRNoVerifactu)."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, but the description still adds execution semantics the annotations cannot: statelessness, determinism, zero data retention, the exact returned fields, and the failure mode (isError=true on malformed date/timestamp/hash). That is material context for trusting and pre-validating inputs, not restatement of annotations.

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?

Front-loaded with outputs and guarantees, then routing and error behavior, with no filler sentences. It is, however, an extremely dense multi-clause construction where outputs, side-effect claims, and sibling routing are compressed into one sentence chain, which costs some parseability.

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?

There is no output schema, so the description must name return values, and it does (canonicalPayload, fingerprintSha256, qrValidationUrl, qrSvg, nifWarning) along with the error path. For a stateless 10-parameter computation tool with 100% schema coverage, nothing an agent needs to invoke it correctly is missing.

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% and each parameter is documented in depth (formats, enums, defaults, normalization rules), so the schema carries the burden; baseline 3 applies. The description only lightly reinforces semantics, clarifying the previousHash chaining role and the 8-field composition, without adding format or constraint detail beyond the schema.

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 ("Compute") with concrete outputs: an 8-field canonical UTF-8 string, a 64-char uppercase SHA-256 Huella, a ValidarQR URL, and a framed SVG QR, plus a regulatory basis (RD 1007/2023, Orden HAC/1177/2024). An agent can tell this apart from verifactu_verify_chain (multi-record audit) and einvoice_generate (full XML) without opening 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?

Gives an explicit positive case ("Use when signing one invoice record or chaining onto a known previousHash") and names the alternatives with the conditions that select them: verifactu_verify_chain for auditing multiple historical records, einvoice_generate for emitting <sf:RegistroAlta> XML. The when/when-not routing is fully spelled out.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources