Skip to main content
Glama

Malhas geográficas

ibge_malhas
Read-onlyIdempotent

Fetch geographic meshes for Brazil, regions, states, or municipalities from IBGE as GeoJSON, TopoJSON, or SVG. Set locality, resolution, and quality to retrieve map boundaries.

Instructions

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.0): fonte, URL, período, extração 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. Changed8 schema fields changedv5.0.0
    • addedInput schema / additionalProperties
      Added value: +false
    • 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)"
  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: -[
      -  "localidade",
      -  "formato"
      -]New value: +[
      +  "localidade",
      +  "formato",
      +  "provenance",
      +  "attribution"
      +]
  4. Changed1 schema field changedv3.0.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "formato": {
      +      "description": "Formato de saída solicitado (geojson, topojson ou svg)",
      +      "type": "string"
      +    },
      +    "intrarregiao": {
      +      "description": "Código de região usado para filtrar (apenas quando localidade=BR)",
      +      "type": "string"
      +    },
      +    "localidade": {
      +      "description": "Código IBGE ou sigla da localidade consultada",
      +      "type": "string"
      +    },
      +    "qualidade": {
      +      "description": "Qualidade do traçado solicitada",
      +      "type": "string"
      +    },
      +    "resolucao": {
      +      "description": "Resolução/divisões internas solicitada",
      +      "type": "string"
      +    },
      +    "tipo": {
      +      "description": "Tipo de divisão territorial, quando informado",
      +      "type": "string"
      +    },
      +    "url": {
      +      "description": "URL para download da malha completa",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "localidade",
      +    "formato"
      +  ],
      +  "type": "object"
      +}
  5. First observedv1.0.0

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's 'read-only and idempotent' sentence largely repeats them. What it does add is the nature of the call — a live GET against the public IBGE Malhas API — which tells the agent data is fetched remotely rather than cached locally.

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?

Well front-loaded: purpose first, then features, locality types, resolution, examples, and sibling routing, all in scannable bullets. It loses a point because the resolution and format enumerations restate schema fields that already carry the same information.

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 an output schema present, the description need not explain return shapes, and annotations carry the safety profile. Given 6 parameters, one required, the description supplies locality coding, resolution levels, format choices, precedence-free guidance, and sibling routing — nothing needed to call it correctly is missing.

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 the baseline is 3 and the schema already documents resolucao, qualidade, formato and intrarregiao. The description goes further by giving worked mappings ('BR' or '1' = Brazil, 'SP'/'35' = São Paulo, 7-digit municipality code) and example parameter combinations, which reduce ambiguity when constructing a call.

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') and enumerates the scope it covers (Brazil, regions, states, municipalities; GeoJSON/TopoJSON/SVG). It also names the sibling it is not — ibge_malhas_tema for thematic meshes — so an agent can separate 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?

Contains an explicit 'Use a different tool when' block that routes thematic meshes (biomes, Legal Amazon, semi-arid, metropolitan regions) to ibge_malhas_tema, plus three concrete invocation examples. The condition that selects the alternative and the condition that selects this tool are both stated.

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