Skip to main content
Glama

Generate reversal document

generate_reversal
Read-onlyIdempotent

Generate a validated reversal XML document from a bank statement by specifying the ISO return reason code, enabling automated processing of returned payments.

Instructions

Generate a validated camt.053.001.14 reversal document from a statement.

This is the headline one-shot workflow: pass an incoming statement and a
return-reason code and get back the reversal XML (nothing is written to
disk). Preview which entries will be reversed first with ``filter_entries``
using the same ``reason_code``.

This is the headline one-shot workflow: parse the incoming camt.053, pick
the entries with the requested return reason (e.g. AC04 Closed Account),
and emit a validated camt.053.001.14 reversal statement.

Returns the validated XML document as a string, or an ``{"error": ...}``
payload (serialized) if generation fails.

Args:
    xml: The raw incoming statement XML as a string.
    reason_code: The ISO external return reason to reverse (default
        ``"AC04"``).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xmlYesThe raw incoming camt.053 statement XML document as a string; the entries carrying reason_code are reversed into a new camt.053.001.14 document.
reason_codeNoAn ISO external return reason code, e.g. 'AC04' Closed Account. Must be exactly one of: 'AC01', 'AC02', 'AC03', 'AC04', 'AC06', 'AC13', 'AC14', 'AG01', 'AG02', 'AM01', 'AM02', 'AM03', 'AM04', 'AM05', 'AM06', 'AM07', 'AM08', 'AM09', 'BE01', 'BE05', 'CNOR', 'DNOR', 'DT01', 'ED01', 'ED05', 'FF01', 'MD01', 'MD06', 'MD07', 'MS02', 'MS03', 'NARR', 'NOAS', 'NOOR', 'RC01', 'RR01', 'RR02', 'RR03', 'RR04', 'SL01', 'TM01' (see list_return_reasons).AC04

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint and idempotentHint. Description adds that it returns validated XML or error, and that no data is written to disk. Some redundancy but adequate transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description contains duplication: the 'headline one-shot workflow' is stated twice with similar wording. The Args section repeats schema info. Could be more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 2 parameters and output schema, the description explains input, output format, and workflow well. It references sibling tools. Minor gap: no mention of input validation or prerequisites.

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% with detailed descriptions. The description adds minimal extra context (ISO reason code, default AC04, reference to list_return_reasons). Baseline 3 is appropriate.

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 clearly states the tool generates a validated camt.053.001.14 reversal document from a statement. It distinguishes from sibling tools like filter_entries (preview) and list_return_reasons.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states it's a one-shot workflow: pass xml and reason_code to get reversal XML, nothing written to disk. Recommends using filter_entries for preview first. Provides clear guidance.

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/camt053-mcp'

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