Skip to main content
Glama
PHIAI-IO

mcp-empresas-brasil

by PHIAI-IO

empresas_contagem

Count Brazilian companies or establishments by municipality, state, CNAE activity, size, or status using official CNPJ registry data. Get filtered totals based on primary or secondary CNAE.

Instructions

Contagem de estabelecimentos (ou empresas) por município, UF, CNAE, grupo, porte ou situação, a partir do dump oficial da Receita. O município já vem convertido para IBGE (o código da Receita é outro). A resposta diz quantos entraram pelo CNAE principal.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoSigla da UF.
baseNoDefault: principal_ou_secundario.
cnaesNoCNAEs (7 dígitos) dentro do recorte do build.
grupoNoGrupo do preset (odontologia: distribuicao, representacao, varejo, clinica, laboratorio, industria).
limitNo
contarNoempresas = CNPJ básico (grupo econômico). Default: estabelecimentos.
situacaoNoDefault: ativa.
municipiosNoCódigos IBGE de 7 dígitos ou DATASUS de 6.
agrupar_porNoDefault: ['grupo'].

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?

With no annotations, the description carries the behavioral burden. It discloses a non-obvious transformation ('município já vem convertido para IBGE') and clarifies that the count reflects entries by CNAE principal, which prevents misinterpretation of the result. It does not cover output format or data freshness, but the key behaviors are surfaced.

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 dense sentences with no filler. The main capability and dimensions are front-loaded, and the caveats are placed immediately after, making the description efficient and scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 9 parameters, no output schema, and no annotations, the description should do more to explain the response shape and when to use this tool. It provides two important caveats but omits result format, pagination/limit behavior, and explicit routing among the sibling tools, leaving the agent with incomplete context.

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 description coverage is 89%, so the schema already documents most parameters. The description adds meaningful parameter-related semantics: it warns that Receita municipality codes differ from IBGE codes and clarifies that the count is based on the principal CNAE, which is not fully captured in the schema.

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 uses a specific verb ('Contagem') and resource ('estabelecimentos (ou empresas)') and lists the grouping dimensions: município, UF, CNAE, grupo, porte, situação. It does not explicitly contrast with sibling tools like empresas_listar, but the counting verb clearly differentiates it from listing or single-CNPJ tools.

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?

The description implies use when aggregate counts are needed and specifies the data source (official Receita dump), but it does not explicitly say when to prefer this over empresas_listar, empresas_cnpj, or how to handle caveats via empresas_data_caveats. Usage context is implied rather than stated.

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