Skip to main content
Glama

Br Validate Cnpj

br__validate_cnpj

Validate Brazilian CNPJ (company tax ID) in both legacy numeric and new alphanumeric formats. Accepts formatted or plain input and confirms validity for NF-e/NFC-e operations.

Instructions

Validate a Brazilian CNPJ (company tax ID).

Accepts both the legacy all-numeric form (14 digits) and the alphanumeric form introduced by NT 2026.004 / PL_010d (12 alphanumeric characters + 2 numeric check digits, production from 2026-07-01).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cnpjYesCNPJ string, with or without ``.``/``/``/``-`` separators.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorNo
validYes
valueNo
country_codeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden. It discloses that both the numeric and alphanumeric CNPJ forms are accepted and cites the relevant standard and effective date, which is useful input-behavior information. It does not state whether validation is purely local or whether it checks registration status, but the check-digit wording implies structural validation.

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?

The description is two tight sentences: purpose is front-loaded, and the technical format details are kept in the second sentence. There is no repetition of the schema or unnecessary 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?

For a one-parameter validation tool with an output schema, this covers the essential input formats and the applicable standard. An explicit note that it validates format/check digits rather than registration status would make it fully complete, but nothing needed for basic invocation 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?

The input schema already describes the single 'cnpj' parameter at 100% coverage, so the baseline is 3. The description adds value beyond the schema by explaining the two accepted formats and the 12-alphanumeric + 2-check-digit structure, which helps the agent construct valid inputs.

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?

The description opens with a specific verb and object: 'Validate a Brazilian CNPJ (company tax ID).' The follow-up sentence naming the legacy and alphanumeric forms makes the tool's scope concrete and distinguishes it from sibling validators such as br__validate_cpf and the XML document validators.

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?

It gives clear context for when to use the tool: whenever a Brazilian CNPJ string must be validated, and it identifies which input representations are acceptable. It does not explicitly name sibling alternatives or state when not to use it, so it falls short of a 5.

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