Skip to main content
Glama
OrtaMarco

mx-fiscal-mcp-server

by OrtaMarco

Validate CLABE

validate_clabe
Read-onlyIdempotent

Validate a Mexican CLABE account number, verify the control digit using Banxico's correct algorithm, and get the bank name from the official participant catalogue.

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 counts only its last digit (the product modulo 10): 9 × 7 = 63 counts as 3. Implementations that borrow the Luhn habit of adding the product's digits (6 + 3 = 9) compute a different control digit — for the base 09000000000000000 the algorithm gives 7 and the Luhn-style sum gives 1. (Reducing modulo 10 before or after summing gives the same result; that is not where they go wrong.) 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.8/5.0
Behavior5/5

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

With readOnlyHint, idempotentHint, and destructiveHint already declaring a safe read operation, the description goes further by disclosing the exact check-digit algorithm, the common Luhn-style error, the curated bank-catalogue limitation, and the decision not to guess plaza cities. This prevents false expectations and is strong behavioral context beyond the 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?

The description is long but well-structured and front-loaded, with the purpose in the first sentence followed by clearly labeled Args, Returns, and an Example. The detailed control-digit explanation earns its place because it clarifies a common source of incorrect validation and explicitly states that this tool uses the correct algorithm.

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 rich annotations, full schema coverage, and an output schema, the description is complete for correct invocation. It covers edge-case behavior (unknown bank codes reported as unknown, plaza codes reported verbatim without guessing), normalization, and output-format selection, leaving no critical gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description adds meaningful parameter behavior: spaces and dashes are normalized away from `value`, and `response_format` is clarified as 'markdown' for a human-readable summary versus 'json' for the full structured payload. This goes beyond the bare schema definitions for both parameters.

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 opens with a specific verb and resource: 'Validate an 18-digit CLABE' and extends the purpose to 'name the bank behind it.' It also gives domain context (Banxico Circular 3/2012, SPEI transfers) that clearly distinguishes this tool from the sibling validators like validate_rfc, validate_curp, and validate_nss.

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

Usage Guidelines4/5

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

The description gives clear contextual triggers: a CLABE is the account number for every SPEI transfer in Mexico, and the tool also resolves the bank, so an agent can infer appropriate use cases. It does not explicitly provide when-not-to-use guidance or name sibling alternatives, but the resource type is unique enough that the gap is minor.

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