Skip to main content
Glama

Migrate records between versions

migrate_records
Read-onlyIdempotent

Migrate flat payment records between pain.001 schema versions (e.g., .03 to .09) when your bank requires a different version. Reports renamed, derived, or dropped fields during transformation.

Instructions

Migrate flat payment records between two pain.001 schema versions.

Use this to upgrade/downgrade records when your bank requires a
different pain.001 version than your source data uses (e.g. move
``.03`` rows to ``.09``); it reports which fields were renamed, derived,
or dropped. This transforms records only — run ``validate_records``
afterwards, then ``generate_message`` to emit XML.

Wraps :class:`pain001.migration.VersionMapper`. Returns the
migrated rows plus a summary of which fields were renamed,
derived, or dropped; ``{"error": ...}`` if either version is
unsupported.

Args:
    records: Records in the ``from_version`` shape.
    from_version: Source pain.001 version (e.g. ``"pain.001.001.03"``).
    to_version: Target pain.001 version (e.g. ``"pain.001.001.09"``).

Returns:
    ``{"records": [...], "migrated": int, "from": str, "to": str}``
    or ``{"error": ...}``.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordsYesFlat payment records in the from_version shape, each a dict of field name → value, to transform to to_version.
to_versionYesTarget pain.001 schema version to migrate the records to, e.g. 'pain.001.001.09' — see list_message_types.
from_versionYesSource pain.001 schema version the records currently use, e.g. 'pain.001.001.03' — see list_message_types.
Behavior5/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and idempotentHint=true. The description adds significant behavioral context: it transforms records only (not XML), reports which fields are renamed/derived/dropped, wraps VersionMapper, returns both migrated rows and a summary, and returns error if version is unsupported. No contradictions with 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?

The description is well-structured with a clear purpose statement, usage context, workflow, technical reference, return format, and parameter list. Every sentence serves a purpose, and the most critical information is front-loaded. It is appropriately sized for the tool's complexity.

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 the tool's complexity (schema version migration), the description is thorough. It explains the transformation process, error handling, return format, and the expected workflow after migration (validate and generate). It references sibling tools for version listing. No gaps remain for an agent to invoke the tool correctly.

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?

The input schema covers 100% of parameters with descriptions. The description's Args section reinforces and adds context, such as examples ('pain.001.001.03'), the shape of records ('each a dict of field name → value'), and references to list_message_types for version options. This adds value 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?

The description explicitly states the tool migrates flat payment records between two pain.001 schema versions, with clear examples ('move .03 rows to .09'). It distinguishes itself from sibling tools like validation and generation tools by specifying the transformation scope.

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?

The description provides detailed when-to-use guidance: 'when your bank requires a different pain.001 version than your source data uses'. It also outlines the recommended workflow (run validate_records afterwards, then generate_message). However, it does not explicitly state when NOT to use this tool or mention alternatives directly.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sebastienrousseau/pain001-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server