Skip to main content
Glama
OrtaMarco

mx-fiscal-mcp-server

by OrtaMarco

Validate CLABE

validate_clabe
Read-onlyIdempotent

Validate an 18-digit Mexican CLABE used for SPEI transfers, check its control digit correctly, and identify the bank behind it.

Instructions

Validate an 18-digit CLABE (Clave Bancaria Estandarizada, Banxico Circular 3/2012) — the account number every SPEI transfer in Mexico is addressed to — and name the bank behind it.

Structure: 3 digits of bank + 3 of plaza (city/branch) + 11 of account + 1 control digit.

The control digit is the part everybody gets wrong. The weights cycle 3-7-1, and each weighted product is reduced modulo 10 before being added to the sum. Implementations that sum the products first — the Luhn habit — accept and reject the wrong numbers. This uses the correct algorithm.

The bank code is resolved against a curated subset of Banxico's participant catalogue. A code that is not in the subset is reported as unknown rather than given an invented name. The plaza code is reported verbatim: the full plaza catalogue is not bundled, so no city is guessed.

Args:

  • value (string): the CLABE. Spaces and dashes are normalised away.

  • response_format ('markdown' | 'json'): output format (default 'markdown').

Returns: { input, normalized, formatted, valid, parts{banco, plaza, cuenta, digito}, bank_code, bank_name, plaza_code, plaza_note, expected_check_digit, errors[{code, message}], findings[] }.

Example: "Which bank is CLABE 012180012345678903?" -> validate_clabe(value="012180012345678903").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYesThe CLABE to validate, e.g. '012180012345678903'.
response_formatNoOutput format: 'markdown' for a human-readable summary (default) or 'json' for the full structured payload.markdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYes
partsYes
validYes
errorsYes
findingsYes
bank_codeYes
bank_nameYes
formattedYes
normalizedYes
plaza_codeYes
plaza_noteYes
expected_check_digitYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the actual validation algorithm (3-7-1 weights reduced mod 10 before summing, and how the Luhn habit fails), the curated-subset policy that returns 'unknown' rather than inventing a bank, and the decision to report plaza verbatim rather than guess a city. These are meaningful behavioral traits the readOnly/idempotent annotations do not convey.

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?

Front-loaded with the core purpose and structure, then background on the algorithm and limitations, all under clear bold headers. The 'Returns' block largely restates the existing output schema, which is mild redundancy but the rest of the content earns its place.

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?

With an output schema present, return values need not be re-explained, and the description otherwise covers normalization, algorithm correctness, and data-coverage caveats. An agent has everything needed to call and interpret it 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?

Schema coverage is already 100%, so the baseline is 3, but the description adds value by noting that spaces and dashes are normalised away in 'value' and contrasting markdown vs json for response_format. This is incremental over the schema rather than contradictory.

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?

States a precise verb (validate) and resource (18-digit CLABE, the account number for every SPEI transfer), then decomposes its structure. Sibling validators (validate_rfc, validate_curp, validate_nss) target different identifiers, and the description makes the CLABE domain unambiguous.

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

Usage Guidelines3/5

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

Usage is implied — you call it when you have a CLABE to check — and the example query demonstrates the invocation. However, there is no explicit when-to-use/when-not guidance nor any named alternative, leaving routing to inference given several sibling validators.

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