Skip to main content
Glama
sebastienrousseau

bankstatementparser-mcp

Detect statement format

detect_format
Read-onlyIdempotent

Detect which bank statement format an inline payload is.

Instructions

Detect which bank statement format an inline payload is.

Use this when you hold statement text but do not yet know its format,
to resolve the ``format`` identifier from the content plus filename
hint. Once the format is known, call ``parse_statement`` to read the
transactions instead of calling this again.

Args:
    content: The raw statement text.
    filename: Original filename; its extension is the primary hint.

Returns:
    The detected format identifier.

Raises:
    ToolError: If the format cannot be detected.

Input Schema

NameRequiredDescriptionDefault
contentYesThe raw statement text to inspect, inline (not a file path). Supported formats include ISO 20022 CAMT.053 and pain.001 XML, SWIFT MT940, CSV exports, and OFX/QFX.
filenameNoOriginal filename of the payload; its extension is the primary detection hint. Recognised extensions: .xml, .csv, .ofx, .qfx, .mt940, .sta. Defaults to 'statement.xml'.statement.xml

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.0.16
    • addedInput schema / properties / content / description
      Added value: +"The raw statement text to inspect, inline (not a file path). Supported formats include ISO 20022 CAMT.053 and pain.001 XML, SWIFT MT940, CSV exports, and OFX/QFX."
    • addedInput schema / properties / filename / description
      Added value: +"Original filename of the payload; its extension is the primary detection hint. Recognised extensions: .xml, .csv, .ofx, .qfx, .mt940, .sta. Defaults to 'statement.xml'."
  2. First observedv0.0.14

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), so the description adds operational context instead: content must be inline rather than a file path, the filename extension is the primary hint, and a ToolError is raised when detection fails. A brief note on confidence or fallback behavior would have made it a 5.

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?

The core guidance is front-loaded in the first two sentences and wastes nothing. The trailing Args/Returns/Raises docstring block is somewhat redundant given a 100%-covered schema and an existing output schema, which costs a point despite otherwise tight structure.

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?

Output schema exists, so the Returns line is optional rather than required, and failure behavior is disclosed via Raises. What is missing is a hint about recovery when detection fails (e.g., pointing at list_supported_formats), which would fully round out the low-complexity two-parameter tool.

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 description coverage is 100%, and the schema already documents supported formats, recognized extensions, and the default filename, so the baseline is 3. The description's Args section largely restates those fields, adding only marginal emphasis ('extension is the primary hint') that the schema also already states.

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 first sentence states a specific verb (Detect) and resource (bank statement format) scoped to an inline payload. It also distinguishes itself from siblings by naming parse_statement as the downstream step once the format is resolved.

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?

It gives an explicit trigger condition ('when you hold statement text but do not yet know its format') and an explicit exclusion/alternative ('call parse_statement to read the transactions instead of calling this again'). That is exactly the when/when-not/alternative structure an agent needs.

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