Skip to main content
Glama
radar-cnpj-mcp

radar-cnpj-mcp

by wendersoon

Contar empresas

contar_empresas
Read-only

Count Brazilian companies matching filters such as CNAE, region, MEI, size, or opening date, with optional grouping by UF, city, neighborhood, sector, or year to reveal totals and distributions.

Instructions

Conta as empresas que atendem aos filtros, opcionalmente agrupando por UF, município, bairro, CNAE, porte, MEI ou ano de abertura. As contagens são exatas sobre toda a base importada, sem amostragem nem teto (números redondos são coincidência); maximo_grupos só limita quantos grupos são listados. Ideal para ver totais e distribuições.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "contar_empresas"
  }
}

Input Schema

NameRequiredDescriptionDefault
meiNoComo tratar Microempreendedores Individuais (MEI).incluir
ufsNoSiglas das UFs, ex.: ["SP", "MG"].
cepsNoPrefixos de CEP, apenas dígitos, ex.: ["13010", "130"].
cnaesNoCódigos CNAE. Com 7 dígitos busca a subclasse exata; com menos dígitos busca por prefixo (ex.: "4520" = toda a classe). Use buscar_cnae para descobrir os códigos.
portesNoPorte declarado à Receita.
bairrosNoTrechos do nome do bairro (busca parcial).
situacaoNoSituação cadastral. Padrão: ativa.ativa
com_emailNoSomente empresas com e-mail cadastrado.
municipiosNoNomes dos municípios, sem diferenciar maiúsculas e acentos. Combine com ufs para evitar homônimos.
aberta_aposNoData de abertura a partir de (AAAA-MM-DD).
agrupar_porNoAgrupar a contagem por esta dimensão. "porte" mostra os MEIs separados das microempresas; "mei" divide entre MEI e não MEI.
capital_maxNoCapital social máximo em reais.
capital_minNoCapital social mínimo em reais.
aberta_antesNoData de abertura até (AAAA-MM-DD).
com_telefoneNoSomente empresas com telefone cadastrado.
maximo_gruposNo
somente_matrizNoIgnorar filiais.
incluir_cnae_secundarioNoTambém considerar empresas que têm o CNAE como atividade secundária.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds genuinely useful behavioral facts: counts are exact over the whole imported base with no sampling or cap, and maximo_grupos limits only how many groups are listed, not the counts themselves. It says nothing about the response shape or how groups are ordered.

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?

Three sentences, front-loaded with the core action and scope before the guarantees and the caveat about maximo_grupos. The parenthetical about round numbers is slightly informal but earns its place by preempting a plausible misinterpretation; no sentence is redundant.

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 an 18-parameter, read-only aggregation tool with no output schema and no required parameters, the description covers what is counted, how it is grouped, and the exactness guarantee. The main remaining gap is a hint at the return structure (group key plus count), which the agent must infer.

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 already 94%, so the baseline is 3, but the description adds real value beyond the schema: maximo_grupos has no schema description at all and is clarified here as limiting only the listed groups, and the exact-count guarantee reframes what the filters produce. It does not elaborate on interactions among filters or on agrupar_por output ordering.

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?

States a specific verb and resource ('Conta as empresas'), the filtering scope, and the optional grouping dimensions by name. It implicitly distinguishes itself from record-returning siblings like buscar_empresas by emphasizing totals and distributions, but never names them explicitly.

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?

'Ideal para ver totais e distribuições' gives a clear use context, and the CNAE caveat routes the agent to buscar_cnae for code discovery. It stops short of stating when to prefer this over buscar_empresas or exportar_csv, so the boundary with listing tools is inferred rather than declared.

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