Skip to main content
Glama

Classificação CNAE

ibge_cnae
Read-onlyIdempotent

Queries CNAE (National Classification of Economic Activities) from IBGE.

CNAE is the official classification for economic activities in Brazil.

Hierarchical structure:

  • Section (letter A-U): 21 main categories

  • Division (2 digits): 87 divisions

  • Group (3 digits): 285 groups

  • Class (4-5 digits): 673 classes

  • Subclass (7 digits): 1,332 subclasses

Features:

  • Search by CNAE code

  • Search by activity description

  • List by hierarchical level

  • Show complete hierarchy

Examples:

  • Search software: busca="software"

  • Specific code: codigo="6201-5/01"

  • View section: codigo="J"

  • List divisions: nivel="divisoes"

Behavior: read-only and idempotent — a live GET against the public IBGE CNAE API. Returns Markdown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buscaNoTermo para buscar na descrição das atividades (ex: 'software', 'restaurante', 'comércio'). Acento e caixa não importam, e várias palavras casam em E ('comercio varejista'). A palavra de todo dia é traduzida para a da CNAE quando preciso — farmácia → produtos farmacêuticos, academia → condicionamento físico, lixo → resíduos — e a resposta diz quando traduziu.
nivelNoNível hierárquico para listar (padrão: mostra todos os níveis relevantes)
codigoNoCódigo CNAE para buscar (seção, divisão, grupo, classe ou subclasse). Exemplos: - Seção: "A" (agricultura) - Divisão: "01" (agricultura e pecuária) - Grupo: "01.1" (produção de lavouras) - Classe: "01.11" (cultivo de cereais) - Subclasse: "0111-3/01" (cultivo de arroz)
limiteNoNúmero máximo de resultados (padrão: 20)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modoYesModo de resposta que gerou os dados
buscaNoPresente no modo de busca por termo
listaNoPresente no modo de listagem por nível
codigoNoPresente no modo de consulta por código
provenanceYesBloco de proveniência (contrato v1.1): fonte, URL, período, extração, diagnóstico de origem e licença
attributionYesURLs canônicas das fontes desta resposta (lista de atribuição)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedOutput schema / properties / provenance / description
      Previous value: -"Bloco de proveniência (contrato v1.0): fonte, URL, período, extração e licença"New value: +"Bloco de proveniência (contrato v1.1): fonte, URL, período, extração, diagnóstico de origem e licença"
    • addedOutput schema / properties / provenance / properties / retrieval
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "anomalies": {
      +          "description": "Anomalias superadas até o sucesso, somadas por classe, em ordem fixa; [] se nenhuma",
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "count": {
      +                "description": "Ocorrências desta classe na chamada",
      +                "maximum": 9007199254740991,
      +                "minimum": 1,
      +                "type": "integer"
      +              },
      +              "kind": {
      +                "description": "Classe da anomalia (vocabulário fechado do contrato)",
      +                "enum": [
      +                  "timeout",
      +                  "network",
      +                  "http_4xx",
      +                  "http_5xx",
      +                  "rate_limited",
      +                  "malformed_body"
      +                ],
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "kind",
      +              "count"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "attempts": {
      +          "description": "Tentativas somadas, incluindo as repetidas (>= requests)",
      +          "maximum": 9007199254740991,
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "requests": {
      +          "description": "Idas distintas à origem que compõem esta resposta (fatias, páginas)",
      +          "maximum": 9007199254740991,
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "unstable": {
      +          "description": "true se houve repetição (attempts > requests) ou alguma anomalia",
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "requests",
      +        "attempts",
      +        "anomalies",
      +        "unstable"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Diagnóstico de origem desta chamada (contrato v1.1): idas à API do IBGE, tentativas somadas e anomalias contornadas; unstable=true quando houve anomalia. null quando nada foi medido (resposta servida só do cache)"
      +}
    • changedOutput schema / properties / provenance / required
      Previous value: -[
      -  "source",
      -  "source_url",
      -  "data_vintage",
      -  "retrieved_at",
      -  "citation",
      -  "license"
      -]New value: +[
      +  "source",
      +  "source_url",
      +  "data_vintage",
      +  "retrieved_at",
      +  "retrieval",
      +  "citation",
      +  "license"
      +]
  2. Changed4 schema fields changed
    • changedInput schema / properties / busca / description
      Previous value: -"Termo para buscar na descrição das atividades (ex: 'software', 'restaurante', 'comércio')"New value: +"Termo para buscar na descrição das atividades (ex: 'software', 'restaurante', 'comércio').\nAcento e caixa não importam, e várias palavras casam em E ('comercio varejista').\nA palavra de todo dia é traduzida para a da CNAE quando preciso — farmácia →\nprodutos farmacêuticos, academia → condicionamento físico, lixo → resíduos — e a\nresposta diz quando traduziu."
    • addedOutput schema / properties / busca / properties / encontrados
      Added value: +{
      +  "description": "Quantidade de atividades que casam o termo no catálogo inteiro (pode ser maior que 'total', que é limitado por 'limite')",
      +  "type": "number"
      +}
    • addedOutput schema / properties / busca / properties / notas_vocabulario
      Added value: +{
      +  "description": "Presente quando o termo foi traduzido para a palavra que a CNAE usa (ex: farmácia → produtos farmacêuticos)",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / busca / required
      Previous value: -[
      -  "termo",
      -  "nivel",
      -  "total",
      -  "resultados"
      -]New value: +[
      +  "termo",
      +  "nivel",
      +  "total",
      +  "encontrados",
      +  "resultados"
      +]
  3. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  4. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, open-world, so the safety profile is covered. The description adds genuinely new context: it is a live GET against the public IBGE CNAE API and returns Markdown. It does not discuss rate limits or error behavior, but it exceeds the annotation bar.

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?

Front-loaded with what CNAE is, then hierarchy, features, examples and behavior in a scannable structure. The per-level counts (21/87/285/673/1332) and some examples duplicate what the schema already conveys, costing a little efficiency.

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?

With an output schema present, rich annotations, and fully documented parameters, the description only needs to frame purpose and usage — which it does. Nothing essential for correct invocation is missing, though it could note the default nivel behavior more explicitly.

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?

Schema description coverage is 100%, so the schema already documents busca, nivel, codigo and limite thoroughly, including the code-format examples that the description also repeats. The description adds no semantics beyond the schema, so the baseline 3 applies.

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?

States a specific verb and resource — querying the CNAE economic-activity classification from IBGE — and the hierarchy detail makes the scope unambiguous. It is clearly distinguishable from the other ibge_* siblings (cidades, sidra, municipios), none of which handle CNAE codes.

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?

The 'Features' list plus four worked examples (busca, codigo for code/section, nivel for listing) tell an agent concretely how to invoke the tool for each intent. It stops short of naming when NOT to use it or routing to a sibling alternative, so it is clear but not fully explicit.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.