Skip to main content
Glama

Filter entries by reason code

filter_entries
Read-onlyIdempotent

Preview statement entries with a specific return reason code to verify which entries a reversal would affect, before executing the reversal.

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_codeNoThe ISO external return reason code to match, e.g. 'AC04' Closed Account (the default). Call list_return_reasons for the full set of accepted codes.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. The description adds significant behavioral detail: pagination behavior when limit is None vs given, the return envelope structure, and error handling for negative offset or limit. These details go beyond what annotations provide.

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: a brief purpose sentence, followed by usage guidance, then a clear enumerated list of arguments. Every sentence adds useful information without redundancy. It fits in a compact block and is easy to scan.

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 has 4 parameters, pagination logic, and an output schema, the description covers all essential aspects: purpose, when to use, behavioral details (pagination, errors), and parameter semantics. It references sibling tools and provides the exact return envelope format. The description is complete and self-contained.

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?

Input schema has 100% coverage with descriptions for all 4 parameters. The description adds value by explaining defaults (e.g., reason_code default 'AC04', limit default None) and clarifying the impact of limit on the return format. It also mentions the paginated envelope shape and error condition. This exceeds the baseline of 3 for high schema coverage.

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 'List only the statement entries carrying a given return reason code.' It specifies the verb 'list', the resource 'statement entries', and the filtering criterion. It also distinguishes itself from the sibling tool 'list_entries' which returns all entries regardless of reason code.

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?

The description explicitly says when to use this tool: 'to preview exactly which entries a reversal would touch before calling generate_reversal.' It provides an alternative: 'For every entry regardless of reason code use list_entries instead.' This gives clear guidance on when to choose this tool over its siblings.

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