Skip to main content
Glama
OrtaMarco

mx-fiscal-mcp-server

by OrtaMarco

Validate RFC

validate_rfc
Read-onlyIdempotent

Validate a Mexican RFC taxpayer ID, split it into parts, and verify the SAT modulus-11 check digit, including generic RFCs. Reports format validity, not SAT registration status.

Instructions

Validate a Mexican RFC (Registro Federal de Contribuyentes) — the SAT taxpayer ID — and break it into its parts. Works for both shapes: 13 characters for a persona física (individual) and 12 for a persona moral (company).

The last character is a modulus-11 check digit over the preceding ones, and this checks it. Two SAT-issued generics are special-cased and reported as such:

  • XAXX010101000 (público en general) does NOT satisfy the check-digit algorithm — the arithmetic asks for a '4' where the SAT wrote a '0'. It is valid by decree, not by maths, which is exactly why so many home-grown validators wrongly reject invoices to the general public.

  • XEXX010101000 (residentes en el extranjero) DOES satisfy it on its own.

The tool reports is_generic and check_digit_satisfied separately so you never have to conflate the two.

Structural validity is not registration. A well-formed RFC may belong to nobody. Only the SAT can say whether one is registered and active, and this server never asks.

Args:

  • value (string): the RFC. Spaces, dashes and lower case are normalised away.

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

Returns: { input, normalized, valid, kind, is_generic, generic_note, parts{iniciales, fecha, homoclave, digito}, birth_date, expected_check_digit, check_digit_satisfied, errors[{code, message}], findings[] }.

Example: "Is GODE561231GR8 a valid RFC?" -> validate_rfc(value="GODE561231GR8").

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYes
inputYes
partsYes
validYes
errorsYes
findingsYes
birth_dateYes
is_genericYes
normalizedYes
generic_noteYes
expected_check_digitYes
check_digit_satisfiedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), and the description adds substantial behavioral detail beyond them: modulus-11 check-digit verification, the two SAT generic special cases and why XAXX010101000 fails the arithmetic, input normalization, and the deliberate separation of is_generic from check_digit_satisfied. This is real disclosure an agent could not infer.

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 operation, then bulletted special cases, then args and returns — well organized and scannable. Slightly long: the aside about home-grown validators wrongly rejecting invoices is editorial rather than operational.

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?

Output schema exists, yet the description still gives the return shape and the meanings of the two easily-confused flags. Combined with the scope caveat and normalization note, an agent has everything needed to call it correctly and interpret the result.

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 100%, so baseline is 3, but the description adds genuine meaning: spaces, dashes and lower case in `value` are normalised away, and the response_format default is restated with intent. The added normalization rule is not visible in the 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?

States a specific verb (validate) and resource (Mexican RFC / SAT taxpayer ID), and immediately disambiguates from sibling validators by naming the two RFC shapes (13-char persona física, 12-char persona moral). An agent can distinguish it from validate_curp/validate_clabe/validate_nss without opening any schema.

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?

Explicitly frames the scope boundary — 'Structural validity is not registration. Only the SAT can say whether one is registered and active' — which tells the agent this tool answers well-formedness, not status. It does not explicitly name a sibling to use instead for registration checks, so it stops short of full routing guidance.

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