Skip to main content
Glama

peppol.sh

Validate a document

validate_document
Read-onlyIdempotent

Checks an invoice or credit note against the Peppol rules (Peppol BIS 3.0, EN 16931) before send_document. Pass document (the same JSON as send_document) or ubl_xml (UBL XML as text), and the company_id of the sender. Sends nothing, uses no credit. Each error has the rule ID (for example BR-S-02) or the field path, and a fix. Run it before every send. If it fails with provider_error, the validation service is down: try again later.

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": {
      "company_id": "<company_id>"
    },
    "name": "validate_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
ubl_xmlNoA UBL Invoice or CreditNote as XML text, at most 5 MB.
documentNoThe document as JSON, the same fields as send_document.
company_idYesThe company that will send the document. Get it from list_companies.

Output Schema

NameRequiredDescriptionDefault
validYes
errorsYes
formatYes
warningsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true and openWorldHint=true, yet the description still adds real value: 'Sends nothing, uses no credit' clarifies the billing side effect, and the error contract (rule ID like BR-S-02 or field path, plus a fix) and the provider_error outage mode are behavioral facts found nowhere in the 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?

Front-loaded with purpose, then the input contract, then behavioral guarantees, then the error and retry note. Five tight sentences with no repetition of schema detail; every clause carries information an agent would otherwise have to guess.

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?

Although an output schema exists (so return shape need not be spelled out), the description still tells the agent what useful error output looks like and what to do on a service outage. For a 3-parameter, nested-schema validation tool, nothing needed for correct invocation 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 100%, so the baseline is 3, but the description adds the either/or semantics not obvious from the schema ('Pass document (the same JSON as send_document) or ubl_xml'), plus that company_id identifies the sender. It doesn't state what happens if both document and ubl_xml are supplied, so it stops short of 5.

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 and resource ('Checks an invoice or credit note') plus the standards applied (Peppol BIS 3.0, EN 16931), which immediately distinguishes it from send_document and get_document_ubl. An agent knows exactly what this tool does without opening the 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 sequencing rule ('Run it before every send', 'before send_document') naming the sibling it precedes, and adds a fallback instruction for the failure case ('If it fails with provider_error ... try again later'). This is when-to-use, alternative, and edge-case handling in one place.

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