Skip to main content
Glama
Juris Licita MCP
by bitbusca

Validar CPF ou CNPJ

validar_documento
Read-onlyIdempotent

Validates CPF and CNPJ check digits, including 2026 alphanumeric CNPJ, locally without database lookups; CPF is returned masked only.

Instructions

Confere o dígito verificador de um CPF ou CNPJ (inclusive o CNPJ alfanumérico de 2026). Roda na sua máquina: não consulta nenhuma base, não diz se o documento existe nem de quem é. O CPF volta só mascarado.

Input Schema

NameRequiredDescriptionDefault
tipoNoForça o tipo; sem ele, decide pelo tamanho.
documentoYesCPF ou CNPJ, com ou sem pontuação.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), yet the description still adds real value: local execution on the user's machine, no external lookup, no existence or ownership assertion, and — importantly — that the CPF is returned only masked. That masking note is output behavior an agent could not derive from the annotations or schema. It stops short of describing the result shape for valid vs. invalid input.

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?

Three short sentences, no filler. The core action is front-loaded and the disclaimers (no database, no ownership, masked return) follow in the order an agent would need them to avoid misusing the result.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter, single-purpose validator with no output schema, the description covers the essential unknowns: what is checked, what is deliberately not checked, and that the CPF comes back masked. A minor gap remains around what the return looks like on an invalid document (error vs. boolean) and how the 'tipo' inference behaves on ambiguous lengths.

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 description coverage is 100%: 'documento' is documented as CPF or CNPJ with or without punctuation, and 'tipo' explains that omitting it makes the tool infer from length. The description adds nothing about either parameter, but with full schema coverage the baseline of 3 is appropriate rather than a penalty.

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 precise verb and resource: checks the check digit (dígito verificador) of a CPF or CNPJ, and adds the non-obvious scope note that the 2026 alphanumeric CNPJ is covered. The clause 'não consulta nenhuma base' implicitly separates it from the sibling consultar_cnpj, which does query a registry, so an agent can choose between them without opening a 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?

Gives strong negative guidance that functions as routing: it does not query any database, does not say whether the document exists, and does not say whose it is — exactly the conditions under which an agent should reach for consultar_cnpj instead. What's missing is an explicit naming of that alternative, so the agent must infer the hand-off rather than being told it.

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