Skip to main content
Glama
berthelius

Frihet MCP Server

Validate E-Invoice XML

validate_einvoice_xml
Read-onlyIdempotent

Validate e-invoice XML documents against format-specific schema and Schematron rules, returning detailed errors with severity and location. Catch invoice errors before dispatch to avoid network transmission costs.

Instructions

Validate an e-invoice XML document against the specified format's schema and schematron rules. Returns a list of errors with severity, XPath location, message, and rule ID. Runs KOSIT validator (XRechnung), Mustang (EN16931), XSD, or Schematron depending on format.

Use before dispatch to catch errors early without incurring network transmission costs. A valid=true response means the document passes all schema + business rule checks.

If the validation backend is not deployed for this workspace, returns an honest 'unavailable' response — never a fabricated valid=true. / Valida un documento XML de factura electronica contra el esquema y reglas schematron del formato especificado.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xmlYesRaw XML string of the e-invoice document to validate / Contenido XML de la factura electronica
formatYesFormat to validate against. Determines which validator and ruleset to apply. / Formato a validar. Determina el validador y conjunto de reglas a aplicar.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
validYesWhether the XML passes all validation rules
errorsYesList of validation findings (empty if valid)
validatorYesValidation engine used
durationMsYesValidation duration in milliseconds
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive. Description adds valuable context: returns 'unavailable' if backend not deployed, runs different validators per format. No contradiction with annotations.

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?

Concise, front-loaded with core purpose, then key details. Spanish translation adds slight redundancy but is acceptable for bilingual context. Every sentence adds value.

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?

Covers validation scope, return format, validators, usage timing, honest unavailable response. Output schema exists, so return details are covered. Complete for agent to use correctly given complexity.

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 coverage is 100% with clear parameter descriptions. Description adds minor context about validators depending on format, but doesn't significantly enhance parameter understanding beyond 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?

Description clearly states it validates e-invoice XML against schema/schematron rules, lists validators and return format (errors with severity, XPath, message, rule ID). Distinguishes from siblings like send_einvoice by focusing on pre-dispatch validation.

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?

Explicitly advises 'Use before dispatch to catch errors early without incurring network transmission costs' – clear when-to-use. Doesn't explicitly mention alternatives, but as the only validation tool among siblings, implicit differentiation is sufficient.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/berthelius/frihet-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server