Skip to main content
Glama

Validar DNI/NIE (España)

es-dni-nie-validate
Read-onlyIdempotent

Valida un DNI español (8 dígitos + letra) o NIE (X/Y/Z + 7 dígitos + letra) con la letra de control módulo 23 del Ministerio del Interior. Solo valida; no devuelve la letra esperada. Cuándo: hay que comprobar sin conexión un documento o número de cuenta de LatAm o España dado por un usuario antes de guardarlo o usarlo; la herramienta solo valida. No para: validar una cédula ecuatoriana (ec-id-validate). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Validates a Spanish DNI (8 digits + letter) or NIE (X/Y/Z + 7 digits + letter) with the official mod-23 control letter (Ministerio del Interior). Validation only; it never returns the expected letter. When: a user-supplied Latin American or Spanish ID or account number has to be checked offline before it is stored or used; the tool only validates. [EN completo / full EN: inputSchema.description]

Input Schema

NameRequiredDescriptionDefault
idYesDNI or NIE (spaces/dashes allowed) (string; required; up to 20 chars).

Output Schema

NameRequiredDescriptionDefault
typeNo
validNo
reasonNo
normalizedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / id / examples
      Added value: +[
      +  "12345678Z"
      +]
  2. Changed1 schema field changed
    • addedInput schema / description
      Added value: +"EN: Validates a Spanish DNI (8 digits + letter) or NIE (X/Y/Z + 7 digits + letter) with the official mod-23 control letter (Ministerio del Interior). Validation only; it never returns the expected letter. When: a user-supplied Latin American or Spanish ID or account number has to be checked offline before it is stored or used; the tool only validates. Not for: validating an Ecuadorian cédula (ec-id-validate). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB."
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes beyond the annotations (readOnlyHint, openWorldHint=false, idempotentHint, destructiveHint=false) by disclosing that it never returns the expected letter, that it makes no network calls and keeps no state, that it is deterministic, and by giving concrete limits (64 KB input, 1 s per call, 1 MB result). Those limits and the 'no expected letter in the output' constraint are not derivable from the 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?

Front-loaded with the purpose and organized under labels (Cuándo, No para, Efectos secundarios, Determinista, Límites), which makes scanning easy. It loses a point for internal repetition ('Solo valida; no devuelve la letra esperada' recurs, and 'la herramienta solo valida' appears twice) and for a full bilingual duplication of the same content.

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 one-parameter read-only validator with rich annotations and an output schema (so return values need not be explained), the description covers everything an agent needs: accepted formats, the excluded sibling, the fact that no expected letter is returned, determinism, and operational limits.

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

Parameters3/5

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

Schema coverage is 100% and the single `id` parameter is already fully described, including the 'spaces/dashes allowed' note and an example. The description restates the accepted DNI/NIE formats in prose, which is helpful reinforcement but adds no meaning beyond the schema, so the baseline 3 applies.

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 (Spanish DNI/NIE) and spells out the exact accepted shapes (8 digits + letter; X/Y/Z + 7 digits + letter) plus the mod-23 control-letter algorithm. It also distinguishes itself from the sibling ec-id-validate by name, so an agent can route without opening either schema.

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

Usage Guidelines5/5

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

Uses explicit 'Cuándo' / 'No para' sections: use it for offline checking of user-supplied Spanish/LatAm IDs before storing or using them, and do NOT use it for Ecuadorian cédulas (ec-id-validate named). Both the inclusion and exclusion conditions are stated.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources