Skip to main content
Glama

Get example corpus file

get_corpus_file
Read-onlyIdempotent

Return a validated pain001 XML example from the market corpus for a given scenario, version, and optional bank variant to show correct payment file structure.

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).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.0.67

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world). The description adds real behavioral context: the returned text is exactly what pain001 ships and passed XSD, ISO MDR, rail profile, and overlay checks, plus the error-shape fallback when no file exists.

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?

Front-loaded with the core action and efficiently sized. The Args section is largely redundant with a fully-covered schema, and the 'Delegates to pain001.corpus.get_file' line is internal-hint filler, but the Returns block earns its place since there is no output schema.

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?

With no output schema present, the description supplies the critical return shape ({"scenario_id", "version", "variant", "xml"}) and the error alternative, which an agent otherwise could not know. Nothing needed to call or interpret the call is missing.

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% and the schema descriptions are in fact richer (they supply concrete examples like 'gb.chaps.property-purchase' and 'gb.example.priority'). The Args block in the description only restates those parameters in vaguer terms ('The scenario', 'The message type'), so it adds little beyond the 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?

States a specific verb (Return) and resource (the XML of one validated example file from the market corpus), and immediately distinguishes it from the list_corpus_files sibling by being the single-file fetch. An agent knows exactly what this returns without opening anything else.

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?

Gives a concrete use context — showing a model, tester, or mapping exercise what a correct file looks like for a country/rail/edition. It does not name an explicit alternative or exclusion, but the context is clear and actionable.

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