Skip to main content
Glama

Comparação entre localidades

ibge_comparar
Read-onlyIdempotent

Compare up to 10 Brazilian municipalities or states using IBGE indicators like population, GDP, and literacy. Generate rankings and statistics to analyze regional differences.

Instructions

Compares data between localities (municipalities or states).

Available indicators:

  • populacao: Current population estimate

  • populacao_censo: Census 2022 population

  • pib: GDP per capita

  • area: Territorial area (km²)

  • densidade: Population density (inhab/km²)

  • alfabetizacao: Literacy rate

  • domicilios: Number of households

Features:

  • Compare up to 10 localities at once

  • Calculate statistics (max, min, average, variation)

  • Generate ranked output

  • Accept municipality codes (7 digits) or state codes (2 digits)

Examples:

  • Compare capitals: localidades="3550308,3304557,4106902", indicador="populacao"

  • Compare states: localidades="35,33,41", indicador="pib"

  • Area ranking: localidades="3550308,3304557", formato="ranking"

  • List indicators: indicador="listar"

Use this tool ONLY to rank/compare 2–10 localities on one indicator. For a single locality, use ibge_cidades (municipal panel), ibge_censo, or ibge_sidra.

Behavior: read-only and idempotent — a live GET against the public IBGE APIs (SIDRA and Localidades). Returns Markdown plus a typed structuredContent payload.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatoNoFormato de saída: tabela, json ou ranking (ordenado)tabela
indicadorNoIndicador para comparação: - populacao: Estimativa populacional atual - populacao_censo: População do Censo 2022 - pib: PIB a preços correntes (Mil Reais) - area: Área territorial (km²) - densidade: Densidade demográfica (hab/km²) - alfabetizacao: Taxa de alfabetização - domicilios: Número de domicílios - listar: Lista indicadores disponíveispopulacao
localidadesYesCódigos IBGE das localidades separados por vírgula (ex: "3550308,3304557,4106902"). Use 7 dígitos para municípios, 2 dígitos para UFs.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nomeNoNome do indicador
tabelaNoTabela SIDRA de origem
formatoNoFormato solicitado
indicadorNoIndicador comparado
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)
localidadesYesLocalidades comparadas, com o valor do indicador
estatisticasNoEstatísticas agregadas (quando há ao menos 2 valores positivos)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv5.0.0
    • addedInput schema / additionalProperties
      Added value: +false
  2. Changed6 schema fields changedv4.0.0
    • changedInput schema / properties / indicador / description
      Previous value: -"Indicador para comparação:\n- populacao: Estimativa populacional atual\n- populacao_censo: População do Censo 2022\n- pib: PIB per capita\n- area: Área territorial (km²)\n- densidade: Densidade demográfica (hab/km²)\n- alfabetizacao: Taxa de alfabetização\n- domicilios: Número de domicílios\n- listar: Lista indicadores disponíveis"New value: +"Indicador para comparação:\n- populacao: Estimativa populacional atual\n- populacao_censo: População do Censo 2022\n- pib: PIB a preços correntes (Mil Reais)\n- area: Área territorial (km²)\n- densidade: Densidade demográfica (hab/km²)\n- alfabetizacao: Taxa de alfabetização\n- domicilios: Número de domicílios\n- listar: Lista indicadores disponíveis"
    • changedOutput schema / properties / localidades / items / properties / valor / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
    • 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: -[
      -  "localidades"
      -]New value: +[
      +  "localidades",
      +  "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": {
      +    "estatisticas": {
      +      "additionalProperties": false,
      +      "description": "Estatísticas agregadas (quando há ao menos 2 valores positivos)",
      +      "properties": {
      +        "maior": {
      +          "type": "number"
      +        },
      +        "media": {
      +          "type": "number"
      +        },
      +        "menor": {
      +          "type": "number"
      +        },
      +        "variacaoPct": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "maior",
      +        "menor",
      +        "media",
      +        "variacaoPct"
      +      ],
      +      "type": "object"
      +    },
      +    "formato": {
      +      "description": "Formato solicitado",
      +      "type": "string"
      +    },
      +    "indicador": {
      +      "description": "Indicador comparado",
      +      "type": "string"
      +    },
      +    "localidades": {
      +      "description": "Localidades comparadas, com o valor do indicador",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "codigo": {
      +            "type": "string"
      +          },
      +          "nome": {
      +            "type": "string"
      +          },
      +          "valor": {
      +            "type": "number"
      +          },
      +          "valorTexto": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "codigo",
      +          "nome",
      +          "valor",
      +          "valorTexto"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "nome": {
      +      "description": "Nome do indicador",
      +      "type": "string"
      +    },
      +    "tabela": {
      +      "description": "Tabela SIDRA de origem",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "localidades"
      +  ],
      +  "type": "object"
      +}
  5. First observedv1.0.0

TDQS

A4.3/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 safety profile is structured. The description adds value beyond that: it discloses the underlying data sources (SIDRA and Localidades public APIs) and the return format (Markdown plus typed structuredContent). It doesn't discuss rate limits or error behavior, keeping it short of 5, but adds genuine context beyond annotations.

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 a clear purpose statement, then structured lists of indicators, features, and examples. Reasonably sized for a tool with this many options. Minor redundancy between the indicator list and schema enum, and examples repeat some information, but overall well-organized and skimmable.

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?

Given an output schema exists, the description need not explain return values, and it appropriately mentions structuredContent. It covers constraints (max 10), accepted inputs, indicator vocabulary, and routing guidance. Missing minor items like the behavioral meaning of 'ranking' vs 'json' formats but overall complete for calling correctly.

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 description coverage is 100% and the schema already enumerates indicators with descriptions and formats. The description repeats the indicator list and code format (7 digits for municipalities, 2 for states), which duplicates schema content rather than adding new meaning. Baseline 3 is appropriate.

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 (compares) and resource (data between localities), enumerates available indicators, and explicitly differentiates from siblings: 'Use this tool ONLY to rank/compare 2–10 localities on one indicator. For a single locality, use ibge_cidades, ibge_censo, or ibge_sidra.' An agent can route correctly without inspecting other schemas.

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?

Explicit when-to-use ('ONLY to rank/compare 2–10 localities on one indicator'), when-not-to-use (single locality), and named alternatives (ibge_cidades, ibge_censo, ibge_sidra). Also gives a hard constraint (up to 10 localities) and concrete examples. Nothing left to inference.

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