Skip to main content
Glama

Detalhes de localidade

ibge_localidade
Read-onlyIdempotent

Fetch complete details for a Brazilian state, municipality, or district from its IBGE code, including region, mesoregion, and microregion hierarchy.

Instructions

Returns details of a specific locality by IBGE code.

Features:

  • State information (2-digit code)

  • Municipality information (7-digit code)

  • District information (9-digit code)

  • Complete hierarchy (region, mesoregion, microregion)

Examples:

  • São Paulo state: codigo=35

  • São Paulo city: codigo=3550308

  • District: codigo=355030805

This tool returns the full record of ONE locality you already have the code for. Use a different tool when:

  • You have a name and need the code → ibge_municipios (municipalities) or ibge_geocodigo (any level)

  • You want to decompose/understand a code's structure → ibge_geocodigo

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tipoNoTipo da localidade. Se não informado, será inferido pelo tamanho do código.
codigoYesCódigo IBGE da localidade (estado: 2 dígitos, município: 7 dígitos, distrito: 9 dígitos)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesCódigo IBGE da localidade
nomeYesNome da localidade
tipoYesTipo da localidade retornada
siglaNoSigla da UF (apenas para estados)
estadoNoEstado da localidade (município ou distrito)
regiaoNoRegião do estado (apenas para estados)
municipioNoMunicípio ao qual o distrito pertence (apenas para distritos)
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)
mesorregiaoNoMesorregião do município
microrregiaoNoMicrorregião do município
regiaoImediataNoRegião imediata do município
regiaoIntermediariaNoRegião intermediária do município

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.6/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, destructiveHint=false, and openWorldHint, so the description does not need to restate safety. It adds genuine value beyond them by naming the backing source ('live GET against the public IBGE Localidades API') and the return format ('Markdown record'). It does not mention any rate limits or auth requirements, which are minor for a public API.

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-loads the purpose, then organizes the remainder into labeled Features, Examples, When-to-use, and Behavior blocks. Every section is short and actionable; the concrete code examples partially duplicate the schema's digit-length note, but they remain useful for disambiguation.

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?

An output schema exists, so return values need not be enumerated; the description still notes the Markdown format. Combined with the hierarchy explanation, the code examples, and the sibling routing rules, an agent has everything needed to call this correctly for a three-level locality lookup.

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% and the schema already documents both 'codigo' digit lengths and the 'tipo' enum with inference from code length, so the baseline is 3. The description's concrete examples (São Paulo state=35, city=3550308, district=355030805) add grounded meaning by mapping real entities onto the abstract code lengths, marginally exceeding the schema.

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 ('Returns details of a specific locality by IBGE code') and immediately clarifies scope with the exact code lengths for state, municipality, and district levels. It explicitly distinguishes itself from siblings by name ('Use a different tool when... ibge_municipios or ibge_geocodigo'), so an agent can route correctly without opening any schema.

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?

Provides an explicit selection condition ('returns the full record of ONE locality you already have the code for') and pairs it with two named alternatives for the opposite cases (having a name, wanting to decompose a code). This is textbook when-to-use / when-not-to-use guidance with named siblings.

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