Skip to main content
Glama

Municípios do Brasil

ibge_municipios
Read-onlyIdempotent

Find Brazilian municipalities and their 7-digit IBGE codes by filtering by state (UF abbreviation/name/code) or searching municipality names.

Instructions

Lists Brazilian municipalities from IBGE.

Features:

  • List municipalities by state (using state abbreviation)

  • List all municipalities in Brazil (5,570 municipalities)

  • Search by municipality name

  • Returns 7-digit IBGE code

Examples:

  • São Paulo municipalities: uf="SP"

  • Search by name: busca="Campinas"

  • MG municipalities containing "Belo": uf="MG", busca="Belo"

Use a different tool when:

  • Resolve/decode a code at any level (region, state, district), not just municipalities → ibge_geocodigo

  • Full details/hierarchy of one locality by code → ibge_localidade

  • Neighboring municipalities → ibge_vizinhos

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoEstado por sigla (SP), nome (São Paulo) ou código IBGE (35). Se não informado, retorna todos os municípios do Brasil.
buscaNoTermo para buscar no nome do município
limiteNoNúmero máximo de resultados (padrão: 100, máximo: 5570)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoUF informada no filtro (como recebida na entrada)
buscaNoTermo de busca aplicado ao nome do município
totalYesTotal de municípios encontrados antes do limite
municipiosYesLista de municípios retornados (após filtro e limite)
provenanceYesBloco de proveniência (contrato v1.0): fonte, URL, período, extração e licença
attributionYesURLs canônicas das fontes desta resposta (lista de atribuição)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv5.0.0
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed4 schema fields changedv4.0.0
    • removedOutput schema / properties / provenance / properties / data_vintage / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / provenance / properties / data_vintage / type
      Added value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / properties / provenance / properties / license / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / provenance / properties / license / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  3. Changed6 schema fields changedv3.3.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / properties / attribution
      Added value: +{
      +  "description": "URLs canônicas das fontes desta resposta (lista de atribuição)",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / provenance
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Bloco de proveniência (contrato v1.0): fonte, URL, período, extração e licença",
      +  "properties": {
      +    "citation": {
      +      "description": "Citação pronta para uso",
      +      "type": "string"
      +    },
      +    "data_vintage": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Período de referência do dado segundo a fonte; null se a fonte não expõe"
      +    },
      +    "license": {
      +      "anyOf": [
      +        {
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "description": "Regime legal do dado"
      +    },
      +    "retrieved_at": {
      +      "description": "Instante real da extração no upstream (ISO-8601, horário de Brasília)",
      +      "type": "string"
      +    },
      +    "source": {
      +      "description": "Fonte oficial do dado (API do IBGE consultada)",
      +      "type": "string"
      +    },
      +    "source_url": {
      +      "description": "URL canônica que reproduz a consulta",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "source",
      +    "source_url",
      +    "data_vintage",
      +    "retrieved_at",
      +    "citation",
      +    "license"
      +  ],
      +  "type": "object"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "municipios",
      -  "total"
      -]New value: +[
      +  "municipios",
      +  "total",
      +  "provenance",
      +  "attribution"
      +]
  4. Changed4 schema fields changedv3.0.0
    • changedInput schema / properties / uf / description
      Previous value: -"Sigla do estado (ex: SP, RJ, MG). Se não informado, retorna todos os municípios do Brasil."New value: +"Estado por sigla (SP), nome (São Paulo) ou código IBGE (35). Se não informado, retorna todos os municípios do Brasil."
    • removedInput schema / properties / uf / maxLength
      Removed value: -2
    • removedInput schema / properties / uf / minLength
      Removed value: -2
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "busca": {
      +      "description": "Termo de busca aplicado ao nome do município",
      +      "type": "string"
      +    },
      +    "municipios": {
      +      "description": "Lista de municípios retornados (após filtro e limite)",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "id": {
      +            "description": "Código IBGE do município",
      +            "type": "number"
      +          },
      +          "nome": {
      +            "description": "Nome do município",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "nome"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "total": {
      +      "description": "Total de municípios encontrados antes do limite",
      +      "type": "number"
      +    },
      +    "uf": {
      +      "description": "UF informada no filtro (como recebida na entrada)",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "municipios",
      +    "total"
      +  ],
      +  "type": "object"
      +}
  5. First observedv1.0.0

TDQS

A4.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint, and destructiveHint=false. The description restates 'read-only and idempotent' and adds the live GET source and Markdown table output, which is useful context but largely redundant with annotations. Output schema exists, so no need to explain returns.

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?

Front-loaded purpose, then features, examples, and exclusions in labeled sections. Every line earns its place with no filler.

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?

Complete for a read-only filtered-list tool: purpose, modes, examples, boundaries, behavior, and output shape all covered. An agent has everything needed to select and invoke 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?

Schema coverage is 100%, so baseline is 3. The description adds value beyond the schema: concreteness of the 7-digit code result, the 5,570 total, and worked examples showing uf setup with busca combined. Marginal lift above schema alone.

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+resource ('Lists Brazilian municipalities from IBGE') and specifies the scope precisely (5,570 municipalities, 7-digit codes). It distinguishes itself from siblings ibge_geocodigo, ibge_localidade, and ibge_vizinhos with explicit routing.

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?

Explicit 'Use a different tool when' section names three alternatives (geocodigo, localidade, vizinhos) and the exact conditions selecting each. Examples show the three main invocation modes. Nothing is left to inference.

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