Skip to main content
Glama
verifactu-mcp

verifactu-mcp

by ArceeDev

validate_invoice_chain

Read-onlyIdempotent

Audit a VERI*FACTU invoice chain by recomputing fingerprints, verifying record links, and reporting breaks, altered records, duplicates, and invalid data.

Instructions

Audit a VERI*FACTU chain of records (in generation order) given as JSON objects.

Each record has the fields of verifactu_hash plus Huella (stored fingerprint) and optionally HuellaAnterior or RegistroAnterior {IDEmisorFactura, NumSerieFactura, FechaExpedicionFactura, Huella} and PrimerRegistro ("S"). For every record the fingerprint is recomputed and compared, and the link to the previous record checked. Reports chain breaks, altered records, PrimerRegistro misuse, duplicate invoices, cancellations of unknown invoices, timestamps going backwards, invalid NIF/dates/amounts/TipoFactura. continues_from: last fingerprint of the previous batch, to audit a chain in pieces. Up to 20,000 records. last_huella is what the next record must link to.

Input Schema

NameRequiredDescriptionDefault
recordsYes
continues_fromNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations by enumerating exactly what is checked and reported: fingerprint recomputation and comparison, previous-record link verification, PrimerRegistro misuse, duplicate invoices, cancellations of unknown invoices, backwards timestamps, and invalid NIF/dates/amounts/TipoFactura. It also discloses a concrete capacity limit (20,000 records) and explains continuation semantics, which is precisely the kind of behavioral context annotations cannot carry.

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?

Purpose and input shape are front-loaded, and nearly every sentence carries load. The long comma-separated list of detected error classes is dense and reads as a run-on, and the trailing `continues_from` / `last_huella` sentences mix input-parameter and return-value concerns, slightly muddling the structure.

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?

For a two-parameter, read-only audit tool with an output schema present, this covers what's needed: input record shape, ordering requirement, batch continuation, and a hard size limit. Return values needn't be re-explained given the output schema, so nothing material 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 0% and the records item schema is a bare object with additionalProperties:true, so the description must carry the load — and it largely does, spelling out `Huella`, optional `HuellaAnterior`, the `RegistroAnterior` sub-fields, and `PrimerRegistro` ("S"), plus the meaning of `continues_from`. It loses a point because the referenced `verifactu_hash` fields are not enumerated here, forcing the agent to consult a sibling, and `last_huella` is described as an output-style field in ambiguous proximity to the input parameters.

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?

Opens with a specific verb+resource+scope: "Audit a VERI*FACTU chain of records (in generation order) given as JSON objects." That distinguishes it clearly from siblings like verifactu_hash (single fingerprint) and validate_verifactu_xml (XML validation), so an agent can route correctly without opening a schema.

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?

Tells the agent the prerequisite shape of the input (records in generation order, JSON objects) and gives an explicit batching workflow via continues_from for auditing "a chain in pieces." It also states the operational ceiling of 20,000 records. It stops short of explicitly naming which sibling to use for single-record hashing or XML input, so it earns a 4 rather than a 5.

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