Skip to main content
Glama

Municípios vizinhos

ibge_vizinhos
Read-onlyIdempotent

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.1): fonte, URL, período, extração, diagnóstico de origem e licença
attributionYesURLs canônicas das fontes desta resposta (lista de atribuição)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedOutput schema / properties / provenance / description
      Previous value: -"Bloco de proveniência (contrato v1.0): fonte, URL, período, extração e licença"New value: +"Bloco de proveniência (contrato v1.1): fonte, URL, período, extração, diagnóstico de origem e licença"
    • addedOutput schema / properties / provenance / properties / retrieval
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "anomalies": {
      +          "description": "Anomalias superadas até o sucesso, somadas por classe, em ordem fixa; [] se nenhuma",
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "count": {
      +                "description": "Ocorrências desta classe na chamada",
      +                "maximum": 9007199254740991,
      +                "minimum": 1,
      +                "type": "integer"
      +              },
      +              "kind": {
      +                "description": "Classe da anomalia (vocabulário fechado do contrato)",
      +                "enum": [
      +                  "timeout",
      +                  "network",
      +                  "http_4xx",
      +                  "http_5xx",
      +                  "rate_limited",
      +                  "malformed_body"
      +                ],
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "kind",
      +              "count"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "attempts": {
      +          "description": "Tentativas somadas, incluindo as repetidas (>= requests)",
      +          "maximum": 9007199254740991,
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "requests": {
      +          "description": "Idas distintas à origem que compõem esta resposta (fatias, páginas)",
      +          "maximum": 9007199254740991,
      +          "minimum": 1,
      +          "type": "integer"
      +        },
      +        "unstable": {
      +          "description": "true se houve repetição (attempts > requests) ou alguma anomalia",
      +          "type": "boolean"
      +        }
      +      },
      +      "required": [
      +        "requests",
      +        "attempts",
      +        "anomalies",
      +        "unstable"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Diagnóstico de origem desta chamada (contrato v1.1): idas à API do IBGE, tentativas somadas e anomalias contornadas; unstable=true quando houve anomalia. null quando nada foi medido (resposta servida só do cache)"
      +}
    • changedOutput schema / properties / provenance / required
      Previous value: -[
      -  "source",
      -  "source_url",
      -  "data_vintage",
      -  "retrieved_at",
      -  "citation",
      -  "license"
      -]New value: +[
      +  "source",
      +  "source_url",
      +  "data_vintage",
      +  "retrieved_at",
      +  "retrieval",
      +  "citation",
      +  "license"
      +]
  2. Changed1 schema field changed
    • addedInput schema / additionalProperties
      Added value: +false
  3. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld and non-destructive, but the description still adds genuinely new behavioral context: the proxying via shared mesoregion, the live GET against the public IBGE Localidades API, and that the return is a Markdown list. The only shortfall is that the repeating of the mesoregion caveat crowds out other traits, such as how results are ordered or limited.

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?

The core sentence is well front-loaded and the examples are useful, but the mesoregion caveat is stated three separate times (in Features, in the first Note, and in the second Note), which is redundant padding on a short definition.

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?

With a full annotation set and an output schema covering the return format, the description only needs to explain scope and behavior, which it does well; the unexplained 'raio' parameter is the one loose end.

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 baseline applies and the description's examples (municipio, uf, incluir_dados) largely duplicate documented fields. Notably it never mentions the 'raio' (radius in km via centroids) parameter, which is arguably in tension with its claim that proximity is only approximated by mesoregion — leaving the agent to reconcile the two from the 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 and resource ('Finds nearby/neighboring municipalities') and immediately distinguishes itself from ibge_municipios by naming that sibling for listing/searching. An agent can separate this from the other ibge_* tools without opening a 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?

Gives concrete when-to-use context plus examples for code lookup, name+uf lookup, and population inclusion, and explicitly routes list/search queries to ibge_municipios. It also warns that exact spatial adjacency is out of scope, which is a real exclusion criterion.

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.