Skip to main content
Glama

Validate a CNPJ

validate_cnpj
Read-only

Checks CNPJ check digits offline for numeric and alphanumeric formats, helping verify Brazilian company identifiers without network access.

Instructions

Checks the CNPJ check digits offline. Supports both the classic numeric format and the alphanumeric format introduced by Receita Federal.

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": "validate_cnpj"
  }
}

Input Schema

NameRequiredDescriptionDefault
cnpjYesCNPJ with or without punctuation

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description reinforces this by stating the check runs offline. It adds genuinely new behavioral context by disclosing support for both the classic numeric and the new alphanumeric CNPJ formats, though it never says what the call returns (e.g., a boolean versus a detail object).

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 behavior and followed by the format support detail. Every clause carries information an agent needs; nothing is padded or repeated.

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 single-parameter, read-only validation tool with full schema coverage and clear annotations, the description covers scope, offline behavior, and accepted formats. The only meaningful omission is the shape of the result, which matters somewhat since no output schema exists.

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 schema already notes punctuation is optional, so the baseline is 3. The description earns an extra point by clarifying that alphanumeric CNPJs are accepted, which meaningfully widens the expected input beyond what the schema text conveys.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Checks the CNPJ check digits offline" gives a specific verb and resource, and the word "offline" signals this is a pure validation tool rather than a registry lookup like lookup_cnpj. It stops short of naming that sibling explicitly, so the differentiation is implied rather than stated.

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 word "offline" and the focus on check digits imply when to use it (local format validation, no network call), but there is no explicit when-to-use statement, no exclusion, and no named alternative such as lookup_cnpj for full registry data.

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