Skip to main content
Glama

Códigos geográficos do IBGE

ibge_geocodigo
Read-onlyIdempotent

Decodes IBGE codes or searches codes by locality name.

Features:

  • Decode region, state, municipality, or district codes

  • Search IBGE code by name

  • Show complete geographic hierarchy

  • Return related codes

Code structure:

  • 1 digit: Region (1=North, 2=Northeast, 3=Southeast, 4=South, 5=Central-West)

  • 2 digits: State (11-53)

  • 7 digits: Municipality

  • 9 digits: District

Examples:

  • Decode municipality: codigo="3550308"

  • Decode state: codigo="35"

  • Search by name: nome="São Paulo"

  • Municipality in state: nome="Campinas", uf="SP"

This tool decodes a code's structure and resolves name→code at any level. Use a different tool when:

  • You only need to list/search municipalities → ibge_municipios

  • You want the full detailed record of one locality → ibge_localidade

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoEstado por sigla (SP), nome (São Paulo) ou código IBGE (35) para restringir a busca por nome de município
nomeNoNome da localidade para encontrar o código IBGE (estado ou município)
codigoNoCódigo IBGE para decodificar. Formatos aceitos: - 1 dígito: Região (1-5) - 2 dígitos: UF (11-53) - 7 dígitos: Município - 9 dígitos: Distrito

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nomeNoNome da localidade resolvida
tipoYesTipo do resultado: localidade decodificada (regiao/uf/municipio/distrito) ou lista de municípios encontrados (lista)
siglaNoSigla da região ou UF, quando aplicável
totalNoQuantidade de municípios encontrados na busca por nome (apenas tipo lista)
codigoNoCódigo IBGE da localidade resolvida (ausente em resultados do tipo lista)
regiaoNoNome da região à qual a UF pertence (apenas tipo uf)
estadosNoEstados pertencentes à região (apenas tipo regiao)
matchesNoMunicípios encontrados na busca por nome (apenas tipo lista)
hierarquiaNoHierarquia geográfica completa, da região ao município/distrito (tipo municipio/distrito)
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)
codigoSidraNoCódigo SIDRA de 6 dígitos do município (apenas tipo municipio)
regiaoCodigoNoCódigo IBGE da região à qual a UF pertence (apenas tipo uf)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive behavior. The description adds useful operational context beyond annotations: it is 'a live GET against the public IBGE Localidades API' and 'Returns Markdown.' It doesn't mention rate limits or error cases, but it provides meaningful extra transparency.

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 well-organized with bullets, code-structure details, examples, and routing guidance. There is minor redundancy between the opening summary, the features list, and the closing 'This tool decodes...' sentence, but overall it is scannable and front-loaded with the most important information.

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?

For a tool with three optional parameters and an output schema, the description covers purpose, accepted formats, usage examples, behavioral guarantees, return format, and explicit alternatives. Nothing essential for an agent to select and invoke this tool correctly is missing.

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 all three parameters with 100% coverage, so the baseline is 3. The description adds value by giving concrete examples (codigo='3550308', nome='São Paulo', nome='Campinas', uf='SP') and by explaining the code hierarchy that governs which param format is valid.

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 action and resource: 'Decodes IBGE codes or searches codes by locality name.' It further clarifies scope by explaining code structure at region, state, municipality, and district levels and explicitly names sibling tools it is not (ibge_municipios, ibge_localidade).

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?

The description provides explicit when-to-use guidance and an explicit 'Use a different tool when' section naming alternatives and their conditions. This lets an agent clearly distinguish this tool from ibge_municipios and ibge_localidade without inspecting their schemas.

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.