Skip to main content
Glama

Validate CNPJ

validate_cnpj
Read-onlyIdempotent

Validate Brazilian CNPJ check digits and format masked, digits-only, or alphanumeric numbers offline; use it to confirm company identifiers before ERP records or integrations rely on them.

Instructions

Check a CNPJ's check digits and format it (accepts masked, digits-only and the new alphanumeric format). Offline.

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, e.g. 11.222.333/0001-81

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover safety (readOnly, idempotent, non-destructive, closed-world), and the description adds genuinely new context: the operation is fully offline and tolerant of three input encodings. It stops short of saying what happens on a failed check-digit test or what the formatted return looks like.

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 with zero filler, front-loading the operation and closing with the key constraint. Nothing could be removed without losing information.

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, no-output-schema validator this is nearly sufficient: the accepted input formats and the offline nature are stated. The only real gap is the shape of the result (validity flag plus formatted string), which an agent must discover by calling it.

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?

With a single parameter and 100% schema description coverage, the schema already carries the semantics. The description does add that masked, digits-only, and alphanumeric forms are all accepted, which is useful beyond the dotted example in the schema, but it does not state whether the value is normalized before checking.

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?

The description names a specific verb pair (check check digits, format) against a specific resource (CNPJ), so the operation is unambiguous. It does not name or differentiate itself from the sibling lookup_cnpj, leaving the validate-vs-lookup distinction to be inferred from the word "Offline."

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?

Usage is only implied: "Offline" suggests this is the local, no-network option versus a lookup tool, and no explicit when-to-use or when-not-to-use condition is stated. An agent can infer the routing but is not told it.

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