Skip to main content
Glama

Malhas geográficas

ibge_malhas
Read-onlyIdempotent

Gets geographic meshes (maps) from IBGE in GeoJSON, TopoJSON, or SVG format.

Features:

  • Meshes for Brazil, regions, states, municipalities

  • Different resolution levels (internal divisions)

  • Different quality levels

  • Formats: GeoJSON (data), TopoJSON (compact), SVG (image)

Locality types:

  • "BR" or "1" = Entire Brazil

  • State abbreviation (e.g., "SP", "RJ")

  • State code (e.g., "35" for SP)

  • Municipality code (7 digits)

Resolution (internal divisions):

  • 0 = Outline only

  • 2 = States

  • 5 = Municipalities

Examples:

  • Brazil with states: localidade="BR", resolucao="2"

  • São Paulo with municipalities: localidade="SP", resolucao="5"

  • SVG format: localidade="BR", formato="svg"

Use a different tool when:

  • Thematic meshes (biomes, Legal Amazon, semi-arid, metropolitan regions) → ibge_malhas_tema

Behavior: read-only and idempotent — a live GET against the public IBGE Malhas API. Returns the mesh in the requested format (GeoJSON, TopoJSON, or SVG).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tipoNoTipo de divisão territorial
formatoNoFormato de saída (padrão: geojson)geojson
qualidadeNoQualidade do traçado: 'minima', 'intermediaria' ou 'maxima' (padrão). Os números 1–4 do IBGE antigo continuam aceitos e são traduzidos.maxima
resolucaoNoDivisões internas a desenhar dentro da malha pedida: 0 = Sem divisões internas (só o contorno) 1 = Macrorregiões (apenas quando localidade=BR) 2 = Unidades da Federação (BR ou uma região) 3 = Mesorregiões 4 = Microrregiões 5 = Municípios Cada nível aceita só as divisões menores que ele: município aceita nenhuma, UF aceita 3, 4 e 5.0
localidadeYesCódigo IBGE ou sigla da localidade (ex: 'BR', 'SP', '35', '3550308')
intrarregiaoNoDivisão interna pelo nome, alternativa a resolucao: 'regiao', 'UF', 'regiao-intermediaria', 'regiao-imediata', 'mesorregiao', 'microrregiao' ou 'municipio'. Quando informado, prevalece sobre resolucao.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL para download da malha completa
tipoNoTipo de divisão territorial, quando informado
formatoYesFormato de saída solicitado (geojson, topojson ou svg)
qualidadeNoQualidade do traçado solicitada
resolucaoNoResolução/divisões internas solicitada
localidadeYesCódigo IBGE ou sigla da localidade consultada
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)
intrarregiaoNoDivisão interna desenhada dentro da malha (vocabulário da API v3)

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. Changed7 schema fields changed
    • changedInput schema / properties / intrarregiao / description
      Previous value: -"Código de região para filtrar (apenas quando localidade=BR)"New value: +"Divisão interna pelo nome, alternativa a resolucao: 'regiao', 'UF', 'regiao-intermediaria', 'regiao-imediata', 'mesorregiao', 'microrregiao' ou 'municipio'. Quando informado, prevalece sobre resolucao."
    • changedInput schema / properties / qualidade / default
      Previous value: -"4"New value: +"maxima"
    • changedInput schema / properties / qualidade / description
      Previous value: -"Qualidade do traçado: 1=mínima, 2=baixa, 3=intermediária, 4=máxima"New value: +"Qualidade do traçado: 'minima', 'intermediaria' ou 'maxima' (padrão). Os números 1–4 do IBGE antigo continuam aceitos e são traduzidos."
    • changedInput schema / properties / qualidade / enum
      Previous value: -[
      -  "1",
      -  "2",
      -  "3",
      -  "4"
      -]New value: +[
      +  "1",
      +  "2",
      +  "3",
      +  "4",
      +  "minima",
      +  "intermediaria",
      +  "maxima"
      +]
    • changedInput schema / properties / resolucao / description
      Previous value: -"Resolução/divisões internas:\n0 = Sem divisões internas\n1 = Macrorregiões (apenas para BR)\n2 = Unidades da Federação\n3 = Mesorregiões\n4 = Microrregiões\n5 = Municípios"New value: +"Divisões internas a desenhar dentro da malha pedida:\n0 = Sem divisões internas (só o contorno)\n1 = Macrorregiões (apenas quando localidade=BR)\n2 = Unidades da Federação (BR ou uma região)\n3 = Mesorregiões\n4 = Microrregiões\n5 = Municípios\nCada nível aceita só as divisões menores que ele: município aceita nenhuma, UF aceita 3, 4 e 5."
    • changedInput schema / properties / tipo / enum
      Previous value: -[
      -  "paises",
      -  "regioes",
      -  "estados",
      -  "mesorregioes",
      -  "microrregioes",
      -  "municipios",
      -  "distritos",
      -  "regioes-imediatas",
      -  "regioes-intermediarias"
      -]New value: +[
      +  "paises",
      +  "regioes",
      +  "estados",
      +  "mesorregioes",
      +  "microrregioes",
      +  "municipios",
      +  "regioes-imediatas",
      +  "regioes-intermediarias"
      +]
    • changedOutput schema / properties / intrarregiao / description
      Previous value: -"Código de região usado para filtrar (apenas quando localidade=BR)"New value: +"Divisão interna desenhada dentro da malha (vocabulário da API v3)"
  4. 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 readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so the safety profile is covered. The description adds the caller-relevant fact that this is a live GET against the public IBGE Malhas API and that the response matches the requested format. It omits pagination/size limits and failure behavior, so it stops short of a 5.

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-loaded with the core purpose, then organized into labeled sections that are easy to scan. Slightly redundant: resolution is explained once in the generic features and again in the 'Resolution' section, and the format list appears twice.

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?

With 6 parameters (4 enum-constrained), an output schema, and full annotation coverage, the description supplies everything an agent needs: purpose, routing, locality/resolution/format conventions, and examples. No material gap remains.

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%, so baseline is 3, but the description earns extra by mapping locality types ('BR'/'1', state abbreviation, state code, 7-digit municipality code) and resolution levels to concrete examples. It restates much of the schema, and intrarregiao is left entirely to the schema, keeping it out of 5 territory.

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 ('Gets geographic meshes (maps) from IBGE') plus output formats, and explicitly distinguishes itself from the sibling ibge_malhas_tema for thematic meshes. An agent can route between the two without opening either 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 explicit 'Use a different tool when' routing to ibge_malhas_tema, plus three concrete invocation examples covering locality/resolution/format combinations. Both when-to-use and when-not-to-use are present.

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.