Skip to main content
Glama

Municípios vizinhos

ibge_vizinhos
Read-onlyIdempotent

Find neighboring municipalities by IBGE code or name, returning those in the same mesoregion and optionally population data. Use for proximity insights.

Instructions

Finds nearby/neighboring municipalities.

Features:

  • Search by IBGE code (7 digits) or municipality name

  • Returns municipalities in the same mesoregion (proximity approximation)

  • Optionally includes population data

Note: Uses mesoregion as geographic proximity proxy. For exact spatial neighborhood, mesh processing would be required.

Examples:

  • By code: municipio="3550308"

  • By name: municipio="Campinas", uf="SP"

  • With population: municipio="3550308", incluir_dados=true

Note: proximity is approximated by shared mesoregion (not exact spatial adjacency). For listing/searching municipalities, use ibge_municipios.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoEstado por sigla (SP), nome (São Paulo) ou código IBGE (35) — obrigatório se usar nome do município
raioNoRaio em km para buscar municípios próximos (usa centróides)
municipioYesCódigo IBGE do município (7 dígitos) ou nome do município
incluir_dadosNoIncluir dados populacionais dos vizinhos

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
totalYesQuantidade de municípios próximos encontrados
vizinhosYesLista de municípios próximos (mesma mesorregião)
municipioYesMunicípio de referência da consulta
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: -[
      -  "municipio",
      -  "vizinhos",
      -  "total"
      -]New value: +[
      +  "municipio",
      +  "vizinhos",
      +  "total",
      +  "provenance",
      +  "attribution"
      +]
  4. Changed2 schema fields changedv3.0.0
    • changedInput schema / properties / uf / description
      Previous value: -"Sigla da UF (obrigatório se usar nome do município)"New value: +"Estado por sigla (SP), nome (São Paulo) ou código IBGE (35) — obrigatório se usar nome do município"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "municipio": {
      +      "additionalProperties": false,
      +      "description": "Município de referência da consulta",
      +      "properties": {
      +        "codigo": {
      +          "description": "Código IBGE do município consultado",
      +          "type": "string"
      +        },
      +        "nome": {
      +          "description": "Nome do município consultado",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "codigo",
      +        "nome"
      +      ],
      +      "type": "object"
      +    },
      +    "total": {
      +      "description": "Quantidade de municípios próximos encontrados",
      +      "type": "number"
      +    },
      +    "vizinhos": {
      +      "description": "Lista de municípios próximos (mesma mesorregião)",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "codigo": {
      +            "description": "Código IBGE do município vizinho",
      +            "type": "string"
      +          },
      +          "nome": {
      +            "description": "Nome do município vizinho",
      +            "type": "string"
      +          },
      +          "populacao": {
      +            "description": "População do município vizinho (apenas quando incluir_dados=true)",
      +            "type": "number"
      +          },
      +          "uf": {
      +            "description": "Sigla da UF do município vizinho",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "codigo",
      +          "nome"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "municipio",
      +    "vizinhos",
      +    "total"
      +  ],
      +  "type": "object"
      +}
  5. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already cover readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so the safety profile is free. The description adds real value beyond that: it discloses the mesoregion-based proximity approximation, the exact-adjacency limitation, and that it returns a Markdown list.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the purpose well, but the mesoregion-proximity caveat is repeated three separate times ('same mesoregion (proximity approximation)', 'Uses mesoregion as geographic proximity proxy', 'proximity is approximated by shared mesoregion'), which is redundant padding in an otherwise structured block.

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?

For a read-only lookup tool with a rich schema and an output schema, the definition is nearly complete: it explains inputs, the approximation model, and the return format. The only meaningful gap is the unaddressed 'raio' parameter, whose centroid-radius semantics sit awkwardly beside the mesoregion-proxy claim.

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 coverage is 100%, so the schema already documents all four parameters; baseline is 3. The description adds code format (7 digits) and name/uf pairing, but never mentions the 'raio' (radius in km) parameter, which is the one parameter whose semantics most conflict with the mesoregion-proximity framing.

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 ('Finds nearby/neighboring municipalities') and explicitly distinguishes itself from the sibling ibge_municipios ('For listing/searching municipalities, use ibge_municipios'). An agent can identify the tool's role without opening the schema.

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?

Provides concrete usage examples (by code, by name+uf, with population) and routes a different task to ibge_municipios. It lacks an explicit statement of when NOT to use it beyond the approximation caveat, but the context is clear.

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