Skip to main content
Glama

Explain error codes

explain_errors
Read-only

Explain rule codes in plain language. Works without an API key.

Covers the codes of validate_invoice findings and hints: EN 16931, XRechnung, ZUGFeRD and Invowerk's own hint codes (IW-*).

Input: codes is a list of one or more codes, e.g. ["BR-CO-18", "BR-DE-21"]. Duplicates are removed. lang is "de" (default) or "en".

Returns lang and explanations. Each explanation has title, meaning, causes, fixes, severity, standard, bt_refs, xpath_hints and explain_url (the German page for the code). If any code is unknown, the call fails and names the unknown codes.

Credits: free. This tool is not metered.

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": {
      "codes": "<codes>"
    },
    "name": "explain_errors"
  }
}

Input Schema

NameRequiredDescriptionDefault
langNoLanguage of the explanations: "de" (default) or "en".de
codesYesOne or more rule codes from validate_invoice, e.g. ["BR-CO-18", "BR-DE-21"].

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / lang / enum
      Added value: +[
      +  "de",
      +  "en"
      +]
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, it discloses that the tool works without an API key, that credits are free and the tool is not metered, that duplicate codes are silently removed, and that an unknown code causes the entire call to fail while naming the bad codes. That failure semantics is exactly the kind of behavior an agent cannot infer from structured fields.

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?

Well front-loaded: purpose first, then input, then return, then cost. The paragraph enumerating every returned field (`title`, `meaning`, `causes`, `fixes`, ...) is somewhat redundant given an output schema exists and is the only place the text drifts from earning its space.

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 lookup, the description covers purpose, code provenance, language handling, dedup, failure mode, and billing. With an output schema present, it is not obligated to enumerate return fields, so no meaningful gap remains.

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 the schema already documents the `lang` enum/default and gives code examples, so the description's restatement of both adds little. The only genuine added meaning is that `codes` must come from `validate_invoice` and that duplicates are deduplicated.

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?

The description opens with a specific verb+resource pair ("Explain rule codes in plain language") and immediately scopes it to "the codes of `validate_invoice` findings and hints," naming the exact standards covered (EN 16931, XRechnung, ZUGFeRD, IW-*). An agent can clearly distinguish this from the sibling `validate_invoice` that produces those codes.

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?

It gives clear usage context by tying the tool to `validate_invoice` findings and hints, which implicitly makes it the follow-up step after validation. It does not state explicit exclusions (e.g. what to do for non-rule errors) or name alternatives, so it falls short of the 5 bar.

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.