Skip to main content
Glama
verifactu-mcp

verifactu-mcp

Build Facturae e-invoice

build_facturae
Read-onlyIdempotent

Build a Spanish Facturae 3.2.2 invoice XML from plain data, computing totals and validating it against the official XSD.

Instructions

Build a Facturae 3.2.2 invoice (XML) from plain data, with totals computed and the official XSD checked.

invoice: number (max 20), series, issue_date, operation_date?, currency (EUR), description?, notes?, legal_literals? [text], receiver_contract_reference?, seller / buyer: nif, name (company name, or first name with first_surname/second_surname for a person), address, post_code, town, province, country (ISO alfa-3, default ESP), residence? (R/U/E), email?, phone?; buyer.face: {oficina_contable, organo_gestor, unidad_tramitadora, organo_proponente?} DIR3 codes for public administration invoices (FACe), or administrative_centres: [{code, role 01-04, name?}], lines: [{description, quantity, unit_price, tax_rate (21, 10, 4, 0...), discount_pct?, surcharge_rate? (recargo de equivalencia 5.2, 1.4, 0.5), tax_type? (01 IVA, 03 IGIC, 02 IPSI), unit? (01 unidades), receiver_reference?, file_reference?, article_code?}], withholding?: {rate} (IRPF retention, e.g. 15 or 7), payment?: {due_date, method (transferencia, domiciliacion, efectivo, tarjeta...), iban, bic?}. Amounts accept "1.234,56" or "1234.56". Returns xml (UTF-8, unsigned), xml_base64, totals and the validation report. Invalid data is refused before charging. Sign the XML (XAdES) before sending to FACe.

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": "build_facturae"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With readOnlyHint/idempotentHint already covering the safety profile, the description still adds real behavior: output is UTF-8 and unsigned, invalid data is rejected before any credit is charged, and the build is deterministic. The only quibble is that a purely in-memory builder disclosing a billing side effect sits slightly at odds with a pure readOnly framing, but nothing is contradicted outright.

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 a one-sentence purpose, then a structured field spec where nearly every line is load-bearing. It is long, but the length is driven by a 0%-coverage schema rather than padding; only the nested seller/buyer block is slightly dense to parse.

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?

For a complex nested-input tool the description supplies the full input contract, the return payload (`xml`, `xml_base64`, `totals`, validation report), and the signing prerequisite — the output schema covers return shape. Minor gaps remain on which invoice fields are mandatory and what the refusal/validation report looks like.

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

Parameters5/5

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

Schema coverage is 0% and the single invoice parameter is an untyped object with additionalProperties:true, so the description must carry the entire contract — and it does, enumerating seller/buyer DIR3 FACe fields, line-level tax types and recargo rates, IRPF withholding, payment methods, ISO alpha-3 country, and accepted amount formats ("1.234,56" or "1234.56"). This is meaning the schema genuinely cannot provide.

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?

"Build a Facturae 3.2.2 invoice (XML) from plain data, with totals computed and the official XSD checked" names a specific verb, the exact standard/version, and the scope (totals + XSD validation). This cleanly separates it from validate_facturae and validate_facturae-style siblings, which check existing XML rather than generate it.

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 gives downstream workflow guidance ("Sign the XML (XAdES) before sending to FACe"), states the pre-condition that invalid data is refused, and implies this is the entry point when you have plain data rather than XML. It stops short of an explicit "use validate_facturae instead when you already have XML" routing statement, so it is clear context without full when/when-not coverage.

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