Skip to main content
Glama

Filter entries by reason code

filter_entries
Read-onlyIdempotent

Filter entries in a camt.053 statement by return reason code to preview which entries a reversal would affect before executing it.

Instructions

List only the statement entries carrying a given return reason code.

Use this to preview exactly which entries a reversal would touch before
calling ``generate_reversal`` with the same ``reason_code``. For every entry
regardless of reason code use ``list_entries`` instead.

When ``limit`` is ``None`` (the default) the full list of matching entries
is returned, preserving the behaviour expected by existing callers. When
``limit`` is given, a paginated envelope ``{"total", "offset", "limit",
"entries"}`` is returned instead, exposing the ``offset:offset + limit``
slice. A negative ``offset`` or ``limit`` yields an ``{"error": ...}``
payload.

Args:
    xml: The raw statement XML as a string.
    reason_code: The ISO external return reason to match (default
        ``"AC04"`` Closed Account).
    offset: The zero-based index of the first entry to return (paginated
        mode only; default ``0``).
    limit: The maximum number of entries to return, or ``None`` for the
        full list (default ``None``).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xmlYesThe raw camt.05x statement XML document as a string; only its entries carrying the given return reason code are returned.
limitNoMaximum number of matching entries to return, starting at offset. None (the default) returns the full unpaginated list; a non-None value returns a {total, offset, limit, entries} envelope. Must be non-negative.
offsetNoZero-based index of the first matching entry to return. Applies only when limit is given; must be non-negative. Defaults to 0.
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
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. Description adds critical behavioral details: the effect of limit=None (returns full list) vs non-None (pagination envelope), and error payload for negative offset/limit. This adds context beyond 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?

Approximately 150 words, well-structured: purpose sentence, usage tip, pagination behavior explanation, then bullet-like Args. Front-loaded with key info, no fluff.

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 4 params (1 required), output schema exists, and annotations cover safety, the description fully documents both output modes (full list and paginated envelope) and error conditions. It also relates to sibling tools. Complete for the tool's complexity.

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 covers all 4 params with descriptions (100% coverage), baseline 3. The description's Args section adds practical usage details: explains xml as 'raw statement XML', reason_code default 'AC04', and clarifies pagination behavior for offset and limit. This adds moderate value beyond 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?

Description clearly states 'List only the statement entries carrying a given return reason code.' It distinguishes from sibling 'list_entries' (all entries) and directly relates to 'generate_reversal' (preview before reversal). This is a specific verb+resource+scope.

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?

Explicit usage advice: 'Use this to preview exactly which entries a reversal would touch before calling generate_reversal' and 'For every entry regardless of reason code use list_entries instead.' Provides clear context and alternatives.

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