Skip to main content
Glama

Validate a CNPJ offline

validate_cnpj
Read-onlyIdempotent

Validates the format and check digits of a numeric or alphanumeric CNPJ offline, without network calls. Confirms a number is well-formed before you query company registry details.

Instructions

Checks the format and the check digits of a CNPJ (numeric or alphanumeric) without any network call. A valid number is not proof that the company exists: use lookup_cnpj for that.

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

A4.6/5.0
Behavior4/5

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

The description reinforces the offline, non-network nature of the check, which matches openWorldHint=false, and adds a meaningful caveat beyond the annotations: a passing result is only syntactic, not proof of the company's existence. It does not describe what the response contains (e.g., which check digit failed), so it stops short of full behavioral disclosure.

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 tight sentences: the first defines what is validated and the offline constraint, the second delivers the critical caveat and the alternative. No filler or repetition of the title.

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 one-parameter, read-only check with full schema coverage, the definition covers purpose, input flexibility, and the key semantic limitation. The only gap is the absence of any hint about the return shape (boolean vs. detailed failure reason), which matters given there is no output schema.

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 would be 3, but the description adds that the input may be alphanumeric as well as numeric, which the schema's 'with or without punctuation' note does not convey. That is real added meaning for the single required parameter.

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 ('Checks the format and the check digits of a CNPJ'), and adds scope detail (numeric or alphanumeric, no network call) that separates it from a data-retrieval tool. It also names lookup_cnpj so the agent can tell the two apart without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent: use this for format/check-digit validation, and use lookup_cnpj when the question is whether the company actually exists. That is an explicit when-to-use-this-versus-the-alternative statement rather than implied guidance.

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