Skip to main content
Glama
alanpcf

brasil-data-mcp

by alanpcf

consultar_cnpj

Retrieve complete Brazilian company registration data by CNPJ, including legal name, status, address, CNAE, partners, and capital. Returns structured JSON for any valid CNPJ.

Instructions

Consulta dados cadastrais de uma empresa brasileira pelo CNPJ na Receita Federal (via BrasilAPI). Retorna em JSON: razão social, nome fantasia, situação cadastral (ativa/baixada/etc), data de abertura, endereço completo, CNAE principal e secundários, sócios (QSA), capital social, natureza jurídica, porte (MEI/ME/EPP/Demais), telefones, e-mail, simples nacional/MEI. Use quando o usuário pedir informações sobre uma empresa identificada por CNPJ. Fonte: BrasilAPI por padrão (sem chave), inclusive CNPJ alfanumérico (IN RFB 2.229/2024). Se a variável de ambiente CPFCNPJ_TOKEN estiver definida, usa o provedor premium cpfcnpj.com.br (dados oficiais em tempo real, pacote configurável) e cai para a BrasilAPI se o provedor falhar; aí o campo 'fonte' na resposta indica a origem. Sem o token a resposta é o JSON cru da BrasilAPI, igual às versões anteriores. NÃO use para: CPF (pessoa física), empresas estrangeiras, ou validação local de formato (rejeite formato inválido sem chamar a tool). Aceita CNPJ com ou sem máscara.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cnpjYesCNPJ da empresa, com ou sem máscara. Aceita numérico ('12.345.678/0001-90' ou '12345678000190') e alfanumérico da IN RFB 2.229/2024 (ex.: '12ABC34501DE35').

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.0
    • changedInput schema / properties / cnpj / description
      Previous value: -"CNPJ da empresa, com ou sem máscara. Aceita '12.345.678/0001-90' ou '12345678000190'. Deve ter 14 dígitos."New value: +"CNPJ da empresa, com ou sem máscara. Aceita numérico ('12.345.678/0001-90' ou '12345678000190') e alfanumérico da IN RFB 2.229/2024 (ex.: '12ABC34501DE35')."
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it delivers: it discloses the default provider, the optional CPFCNPJ_TOKEN premium provider, fallback behavior, the 'fonte' field in responses, the raw BrasilAPI JSON shape without a token, and invalid-format rejection behavior. This is thorough and goes far beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but well organized: purpose and output first, provider behavior second, exclusions last. It is longer than strictly necessary (e.g., 'igual às versões anteriores' is legacy context), but every major sentence earns its place and the critical information is front-loaded.

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?

There is no output schema, but the description compensates by listing the JSON fields returned (razão social, QSA, CNAE, porte, etc.). It also covers provider selection, fallback, optional authentication, and validation behavior, so an agent has everything needed to call the tool correctly.

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 schema already documents the single CNPJ parameter at 100% coverage, so the baseline is 3. The description adds value by explicitly requiring invalid-format rejection before invoking the tool and by confirming both masked/unmasked and alphanumeric CNPJ acceptance, reinforcing and slightly extending the schema semantics.

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 resource: 'Consulta dados cadastrais de uma empresa brasileira pelo CNPJ na Receita Federal (via BrasilAPI).' It enumerates the returned data and clearly distinguishes this from the sibling lookup tools (CEP, banco, feriados, etc.), so an agent can identify what the tool does at a glance.

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?

It states exactly when to use the tool ('Use quando o usuário pedir informações sobre uma empresa identificada por CNPJ') and gives explicit when-not-to-use guidance: CPF, foreign companies, and local format validation, including the instruction to reject invalid formats without calling the tool. This is explicit routing beyond the sibling names.

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