Skip to main content
Glama
OrtaMarco

mx-fiscal-mcp-server

by OrtaMarco

Validate NSS (IMSS)

validate_nss
Read-onlyIdempotent

Validate an 11-digit IMSS NSS by verifying its Luhn check digit and splitting it into subdelegación, registration year, birth year, serial, and check digit.

Instructions

Validate an 11-digit NSS (Número de Seguridad Social) issued by the IMSS, and split it into its fields: 2 digits of subdelegación, 2 of the year the holder was registered, 2 of the year of birth, 4 of serial, and a Luhn check digit over the first ten.

The two year fields are informational only. The IMSS has issued numbers whose years do not line up with the holder's records, so a mismatch is not grounds to reject a number — only the check digit is.

Args:

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

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

Returns: { input, normalized, valid, parts{subdelegacion, anioAlta, anioNacimiento, folio, digito}, expected_check_digit, errors[{code, message}], findings[] }.

Example: "Is 12345678903 a valid NSS?" -> validate_nss(value="12345678903").

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueYesThe NSS to validate, e.g. '92119624722'.
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
normalizedYes
expected_check_digitYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations cover the safety profile (read-only, idempotent, non-destructive), but the description adds real behavioral context beyond them: spaces and dashes are normalized away before validation, and the two year fields are informational because IMSS-issued numbers can mismatch holder records — so only the check digit justifies rejection. That is the kind of edge-case semantics an agent could not infer from structured fields.

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?

Well front-loaded: purpose first, then field breakdown, then the rejection caveat, then args/returns/example. The explicit Returns block is partly redundant given a full output schema exists, but the overall structure is scannable and every other sentence 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?

For a single-parameter validator with an output schema, nothing material is missing: it covers input normalization, output shape, the informational-field caveat, and a concrete invocation example. An agent has everything needed to call 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 description coverage is 100%, so a 3 is the baseline, but the description exceeds it by disclosing normalization of spaces and dashes in `value` and confirming the default of `response_format` to markdown. These details add meaning beyond the schema's terse parameter docs.

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 and resource — validate an 11-digit NSS issued by the IMSS — and distinguishes itself from the sibling validators (validate_curp, validate_rfc, validate_clabe) by document type. It further explains the internal structure of the identifier, making the scope 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 by the document type being validated, and the description gives genuinely useful domain guidance that only the check digit can invalidate a number. However, it never states when to reach for this tool versus a sibling validator or when a caller would already have a normalized value, so routing guidance is left to inference.

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