Skip to main content
Glama

Validar CPF ou CNPJ

validar_documento

Validate Brazilian CPF (11 digits) or CNPJ (14 digits) check digits and return the formatted document; accepts input with or without punctuation.

Instructions

Valida CPF (11 dígitos) ou CNPJ (14 dígitos numéricos) pelos dígitos verificadores e devolve o número formatado. Aceita com ou sem pontuação.

Input Schema

NameRequiredDescriptionDefault
documentoYesCPF ou CNPJ, com ou sem máscara

Output Schema

NameRequiredDescriptionDefault
tipoYes
motivoNo
validoYes
formatadoYes
somenteDigitosYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It does disclose the validation mechanism (check digits), the accepted input formats, and that the output is the formatted number — genuine value. It does not say what happens on an invalid document (error vs. boolean), which is the key behavioral question for a validator.

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?

Two short sentences, front-loaded with the core action and augmented with the one detail that matters (input formatting). No filler.

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?

With an output schema present, the return value needn't be explained, and the description covers input formats and validation logic. The only real gap is failure behavior for invalid documents, which no annotation covers.

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% and the single parameter is already documented as 'CPF ou CNPJ, com ou sem máscara'. The description goes slightly beyond it by giving the digit counts (11/14) and naming the validation rule, which helps an agent pre-validate input before calling.

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 (validar) and specific resources (CPF de 11 dígitos / CNPJ de 14 dígitos), plus the mechanism (dígitos verificadores) and the shape of the result (número formatado). This clearly distinguishes it from siblings like validar_pix and validar_boleto, which validate different artifact types.

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?

The description makes the input context clear (accepts with or without punctuation) but never says when to prefer this over validar_pix or validar_boleto, nor what to do when a document is invalid. Usage is implied by the resource name rather than routed explicitly.

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