Skip to main content
Glama

Validar CNPJ

validar_cnpj
Read-onlyIdempotent

Validates numeric or alphanumeric CNPJ check digits offline and returns the formatted number, so you can confirm a CNPJ is valid before storing or using it.

Instructions

Confere os dígitos verificadores de um CNPJ, numérico ou alfanumérico (formato emitido a partir de julho de 2026), e devolve o número formatado. Não acessa a internet. Use antes de gravar um CNPJ ou quando só precisa saber se ele é válido.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cnpj": "<cnpj>"
    },
    "name": "validar_cnpj"
  }
}

Input Schema

NameRequiredDescriptionDefault
cnpjYesCNPJ com ou sem pontuação

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely new behavioral context: offline operation, acceptance of the alphanumeric format emitted from July 2026, and the fact that it returns a formatted value rather than a lookup result.

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, zero filler, with the core definition front-loaded and the usage call-out placed after it. Every clause carries information the agent needs.

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 covers input forms, offline behavior, the returned value, and when to reach for it. Nothing an agent needs in order to call it correctly 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% and already notes punctuation is optional, so the baseline is 3. The description adds meaning the schema lacks by explicitly allowing the alphanumeric CNPJ form, which materially affects what the agent may pass in.

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 and resource ('Confere os dígitos verificadores de um CNPJ'), narrows it to numeric or alphanumeric input, and notes it returns the formatted number. The phrase 'Não acessa a internet' plus 'quando só precisa saber se ele é válido' separates it from a lookup-style sibling like consultar_cnpj without naming it.

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 two concrete usage triggers: before persisting a CNPJ and when only validity matters. It does not explicitly name the alternative (consultar_cnpj) or state when not to use it, which is what would be needed for a top score.

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