Skip to main content
Glama

Calculate/validate a Spanish DNI, NIE or CIF check character

validate_spanish_tax_id
Read-only

Two modes in one input. If valor is only 1-8 digits, computes the DNI check letter and returns the full 8-digit-plus-letter DNI (digits are left-padded with zeros). If valor is a full document, validates its check character: DNI (8 digits + letter), NIE (X/Y/Z + 7 digits + letter) or CIF (entity letter + 7 digits + check digit or letter, with the entity type per Orden EHA/451/2008). Tolerates spaces, dots, dashes and an ES prefix. Pure arithmetic: it does NOT confirm the document exists, is active or belongs to the person who gave it. In validation mode, returns valido (true/false) and, when it does not match, the correct check character (letra_correcta / control_correcto).

Input Schema

NameRequiredDescriptionDefault
valorYes1-8 digits, or a full DNI/NIE/CIF

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description discloses critical behavior: it is pure arithmetic and does NOT confirm document existence, active status, or ownership. It also describes the return values in validation mode, including valido and corrected check characters.

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 dense but front-loaded with 'Two modes in one input,' then systematically covers calculation, validation, format tolerance, limitations, and return values. Every sentence carries useful information and there is no redundant filler.

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 validation tool with no output schema, the description fully equips an agent to call it correctly: it explains the two modes, accepted input formats, scope limitations, and expected validation responses. Nothing essential is missing.

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 the baseline is 3, but the description adds meaningful semantics for the single `valor` parameter: accepted formats, left-padding behavior, and the distinction between numeric-only and full-document input. It could be even stronger by detailing CIF entity-letter rules, but it already adds substantial value beyond 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?

The description states a specific verb (calculate/validate) and resource (Spanish DNI, NIE, CIF check character), and immediately explains the two input modes. It is clearly distinguishable from siblings like validate_iban or check_vat_number.

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 usage context by explaining that 1-8 digits triggers DNI calculation while a full document triggers validation, and notes formatting tolerance. It does not explicitly compare against sibling validation tools such as check_vat_number, so it falls short of a 5.

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