Validate NSS (IMSS)
validate_nssValidate 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
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | The NSS to validate, e.g. '92119624722'. | |
| response_format | No | Output format: 'markdown' for a human-readable summary (default) or 'json' for the full structured payload. | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | ||
| parts | Yes | ||
| valid | Yes | ||
| errors | Yes | ||
| findings | Yes | ||
| normalized | Yes | ||
| expected_check_digit | Yes |