Skip to main content
Glama

Get example corpus file

get_corpus_file
Read-onlyIdempotent

Retrieve validated example payment XML for a given market scenario, message version, and optional bank variant. Use it as reference or test fixture.

Instructions

Return the XML of one validated example file from the market corpus.

Use this to show a model, a tester or a mapping exercise what a
correct file for a given country and rail looks like in a given
edition. The text is exactly what pain001 ships; it passed the XSD,
the ISO MDR rules, the rail profile and the overlay when it was built.

Delegates to :func:`pain001.corpus.get_file`.

Args:
    scenario_id: The scenario.
    version: The message type.
    variant: The overlay id of a bank variant, else ``None``.

Returns:
    ``{"scenario_id", "version", "variant", "xml"}``, or
    ``{"error": ...}`` when there is no such file or no corpus.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
variantNoAn overlay id for the bank variant, e.g. 'gb.example.priority'; omit for the generic file.
versionYesThe message type, e.g. 'pain.001.001.09'.
scenario_idYesThe market scenario, e.g. 'gb.chaps.property-purchase' (from list_corpus_files).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
xmlNo
errorNo
variantNo
versionNo
scenario_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.0.71
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "One corpus XML file with the request echoed beside it.",
      +  "properties": {
      +    "error": {
      +      "title": "Error",
      +      "type": "string"
      +    },
      +    "scenario_id": {
      +      "title": "Scenario Id",
      +      "type": "string"
      +    },
      +    "variant": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "title": "Variant"
      +    },
      +    "version": {
      +      "title": "Version",
      +      "type": "string"
      +    },
      +    "xml": {
      +      "title": "Xml",
      +      "type": "string"
      +    }
      +  },
      +  "title": "CorpusFileResult",
      +  "type": "object"
      +}
  2. Addedv0.0.67

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, the description adds valuable behavior: the file is validated against XSD, ISO MDR rules, rail profile, and overlay; it is exactly what pain001 ships; it delegates to pain001.corpus.get_file; and it returns an error when the file or corpus is missing. This is rich, non-obvious context.

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?

The description is front-loaded with the core action, followed by a concise use case, validation guarantees, delegation note, and a structured Args/Returns section. Every sentence adds useful information and the length is appropriate for a tool with three parameters and a custom return shape.

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?

The description covers the tool's purpose, when to use it, what guarantees the returned XML has, the parameters, the return structure, and the error case. Nothing an agent needs to invoke it correctly is missing, especially given the annotations and schema already present.

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%, so the schema already documents all three parameters with examples. The Args section in the description mostly restates the schema ('scenario_id: The scenario', 'version: The message type', 'variant: The overlay id...') without adding new semantic detail, so the baseline of 3 applies.

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 and resource: 'Return the XML of one validated example file from the market corpus.' This clearly distinguishes it from sibling tools like list_corpus_files, get_corpus_provenance, and get_corpus_coverage by focusing on retrieving a single file's XML content.

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 explicit use cases: 'Use this to show a model, a tester or a mapping exercise what a correct file for a given country and rail looks like in a given edition.' It does not mention when not to use it or name alternatives, but the context is clear enough for an agent to select it appropriately.

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