Skip to main content
Glama

Explain an FSE validation error

explain_schematron_error
Read-onlyIdempotent

Converts FSE 2.0 gateway XSD/Schematron error messages or rule IDs into plain-language explanations and fix suggestions for rejected CDA2 documents, without requiring the document itself.

Instructions

Explains in plain language an XSD or schematron error returned by the FSE 2.0 gateway for a CDA2 document, and suggests how to fix it. Input is the error message or rule id, not the document.

Input Schema

NameRequiredDescriptionDefault
errorYesThe error message or rule id returned by the FSE gateway or a validator, for example "ERRORE-4| Almeno un elemento 'templateId' ..." or "cvc-complex-type.2.4.a". Do not include patient data.

Output Schema

NameRequiredDescriptionDefault
noteYes
matchedYes
matchesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior, so safety is covered. The description adds relevant behavioral context: it interprets errors in plain language and proposes fixes, and it constrains the input to error text or rule id rather than documents. It does not need to describe return values because an output schema exists.

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?

Two compact sentences, front-loaded with the tool's purpose and followed by the key input constraint. Every sentence adds relevant information with no waste.

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?

Given a single-parameter, read-only, idempotent tool with full schema coverage, annotations, and an output schema, the description is complete enough for correct invocation. It states what the tool does, what the input is, and what value it provides.

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 schema already documents the single error parameter with examples and a privacy warning. The description adds useful semantic clarification that the input is the error message or rule id, not the CDA document itself.

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 uses a specific verb and resource: it explains XSD or schematron validation errors from the FSE 2.0 gateway for CDA2 documents and suggests fixes. It also clarifies the input is an error message or rule id, not the document, which distinguishes it from sibling tools like validate_cda.

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 clearly implies when to use the tool: after receiving an error from the FSE gateway or validator, to get a plain-language explanation and fix. It explicitly says the input is not the document, which helps avoid confusion with validate_cda, but it does not name alternatives or state exclusions explicitly.

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