Skip to main content
Glama

ibge_geocodigo

Read-onlyIdempotent

Decodes IBGE geographic codes and searches codes by locality name. Provides region, state, municipality, or district code breakdown.

Instructions

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
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
nomeNoNome da localidade para encontrar o código IBGE (estado ou município)
ufNoEstado por sigla (SP), nome (São Paulo) ou código IBGE (35) para restringir a busca por nome de município

Output Schema

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

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true. The description adds context: 'read-only and idempotent — a live GET against the public IBGE Localidades API. Returns Markdown.' This aligns with and enriches the annotations.

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-structured with clear sections, but slightly lengthy. However, every part adds value, and the first sentence is front-loaded with purpose. A 4 reflects good organization without waste.

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?

Given the tool has an output schema, the description need not explain return values. It covers decoding, searching, code structure, examples, and alternatives, making it fully contextual for agent invocation.

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 100%, meeting baseline of 3. The description adds value beyond the schema by providing code structure details and examples for each parameter, aiding correct usage.

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 clearly states 'Decodes IBGE codes or searches codes by locality name', specifying the verb and resource. It distinguishes from siblings by mentioning ibge_municipios and ibge_localidade as alternatives.

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?

Explicitly states when to use a different tool, listing ibge_municipios for listing/searching municipalities and ibge_localidade for full detailed records. This provides clear guidance on alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SidneyBissoli/ibge-br-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server