Skip to main content
Glama

Comparação entre UFs e regiões

compare_regions
Read-onlyIdempotent

Compare Brazilian hospital admissions across states or regions to generate rankings and identify regional variations.

Instructions

Compara internações entre UFs ou regiões do Brasil. Gera rankings e identifica variações regionais. Em 1992–1997 uf é a UF do arquivo (estabelecimento), não de residência — ver get_available_years.uf_basis e as notes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearNoAnos para consultar
limitNoNúmero de resultados (default: 10)
metricNoMétrica para ranking (default: n)
is_csapNoFiltrar apenas CSAP
compare_byNoComparar por UF ou região (default: uf)
cid_chapterNoCapítulo CID-10 específico

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoSempre vazio: só aparece no caminho de erro-mole do funil
noteNoComo obter o dado (por exemplo, consultar get_available_years)
errorNoMotivo pelo qual não há dados nesta resposta (ano sem dado, cobertura populacional, falha na consulta)
notesNoAvisos que qualificam os números: era CID-9, raça/cor ausente, universo do % ICSAP, denominador populacional, truncamento
metricNoMétrica que ordena o ranking
rankingNoRanking em ordem decrescente da métrica
compare_byNoEixo da comparação (hoje ambos agrupam por UF)
provenanceYesBloco de proveniência (contrato v1.0): fonte, URL, competência, extração e licença
attributionYesURLs canônicas das fontes desta resposta (lista de atribuição)
published_yearsNoAnos que o canal de cubos publica — a verdade do canal, distinta do que esta instância tem em disco; só com o cache de cubos ligado
total_locationsNoQuantas localidades no ranking
available_sih_yearsNoAnos com dados SIH atendíveis por este servidor
years_not_availableNoPresente só quando parte dos anos pedidos não tem dado: os números cobrem apenas os anos atendidos

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.1
    • addedOutput schema / properties / published_years
      Added value: +{
      +  "description": "Anos que o canal de cubos publica — a verdade do canal, distinta do que esta instância tem em disco; só com o cache de cubos ligado",
      +  "items": {
      +    "type": "number"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changedv0.17.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "anyOf": [
      +    {
      +      "required": [
      +        "compare_by",
      +        "metric",
      +        "ranking",
      +        "total_locations"
      +      ]
      +    },
      +    {
      +      "required": [
      +        "error"
      +      ]
      +    }
      +  ],
      +  "description": "Ranking de UFs por internações ou óbitos; `error` quando nenhum ano pedido tem dado",
      +  "properties": {
      +    "attribution": {
      +      "description": "URLs canônicas das fontes desta resposta (lista de atribuição)",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "available_sih_years": {
      +      "description": "Anos com dados SIH atendíveis por este servidor",
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    "compare_by": {
      +      "description": "Eixo da comparação (hoje ambos agrupam por UF)",
      +      "enum": [
      +        "uf",
      +        "region"
      +      ]
      +    },
      +    "data": {
      +      "description": "Sempre vazio: só aparece no caminho de erro-mole do funil",
      +      "items": {},
      +      "type": "array"
      +    },
      +    "error": {
      +      "description": "Motivo pelo qual não há dados nesta resposta (ano sem dado, cobertura populacional, falha na consulta)",
      +      "type": "string"
      +    },
      +    "metric": {
      +      "description": "Métrica que ordena o ranking",
      +      "enum": [
      +        "n",
      +        "deaths"
      +      ]
      +    },
      +    "note": {
      +      "description": "Como obter o dado (por exemplo, consultar get_available_years)",
      +      "type": "string"
      +    },
      +    "notes": {
      +      "description": "Avisos que qualificam os números: era CID-9, raça/cor ausente, universo do % ICSAP, denominador populacional, truncamento",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "provenance": {
      +      "additionalProperties": false,
      +      "description": "Bloco de proveniência (contrato v1.0): fonte, URL, competência, extração e licença",
      +      "properties": {
      +        "citation": {
      +          "description": "Citação pronta para uso",
      +          "type": "string"
      +        },
      +        "data_vintage": {
      +          "description": "Competência ou safra do dado segundo a fonte; null quando a fonte não expõe",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "license": {
      +          "description": "Regime legal do dado (id SPDX quando há)",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "retrieved_at": {
      +          "description": "Instante REAL da extração na origem (ISO-8601)",
      +          "type": "string"
      +        },
      +        "source": {
      +          "description": "Fonte oficial do dado",
      +          "type": "string"
      +        },
      +        "source_url": {
      +          "description": "URL canônica que reproduz a consulta ou localiza a fonte",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "source",
      +        "source_url",
      +        "data_vintage",
      +        "retrieved_at",
      +        "citation",
      +        "license"
      +      ],
      +      "type": "object"
      +    },
      +    "ranking": {
      +      "description": "Ranking em ordem decrescente da métrica",
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "deaths": {
      +            "description": "Óbitos",
      +            "type": "number"
      +          },
      +          "mortality_rate": {
      +            "description": "Óbitos / internações × 100, duas casas",
      +            "type": "number"
      +          },
      +          "n_hospitalizations": {
      +            "description": "Internações",
      +            "type": "number"
      +          },
      +          "rank": {
      +            "description": "Posição, 1 = maior",
      +            "type": "number"
      +          },
      +          "uf": {
      +            "description": "UF",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "rank",
      +          "uf",
      +          "n_hospitalizations",
      +          "deaths",
      +          "mortality_rate"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "total_locations": {
      +      "description": "Quantas localidades no ranking",
      +      "type": "number"
      +    },
      +    "years_not_available": {
      +      "additionalProperties": false,
      +      "description": "Presente só quando parte dos anos pedidos não tem dado: os números cobrem apenas os anos atendidos",
      +      "properties": {
      +        "note": {
      +          "description": "Quais anos ficaram fora e quais os números cobrem",
      +          "type": "string"
      +        },
      +        "years": {
      +          "description": "Anos pedidos que não têm dados SIH e ficaram fora do resultado",
      +          "items": {
      +            "type": "number"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "years",
      +        "note"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "provenance",
      +    "attribution"
      +  ],
      +  "type": "object"
      +}
  3. Changed1 schema field changedv0.15.4
    • addedInput schema / additionalProperties
      Added value: +false
  4. First observedv0.12.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive behavior. The description adds a useful non-obvious caveat: in 1992–1997, the UF dimension refers to the establishment/file UF rather than residence, and it points to get_available_years.uf_basis and the notes for further detail. It does not explain ranking order or limit behavior, but the output schema reduces the need for that.

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

Conciseness5/5

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

Three sentences with no filler: the first states the action, the second states the output value, and the third delivers an important temporal caveat. Everything is front-loaded and earns its place.

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?

For a read-only tool with 100% schema coverage, two enums, an output schema, and annotations, the description needs little else. It provides a clear purpose, the kind of results it generates, and the key historical data caveat, making it complete enough for an agent to select and invoke correctly.

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 description coverage is 100%, so the baseline is 3. The description adds meaning beyond the schema by clarifying that the uf/compare_by semantic changes in 1992–1997, which is not evident from the enum description 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?

The description states a specific verb and resource: it 'compara internações entre UFs ou regiões do Brasil' and clarifies that it produces rankings and identifies regional variations. This is enough to distinguish it from siblings like compare_icsap_trends, which focus on ICSAP trends rather than general hospitalization comparisons by geography.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The intended use is implied: use it when comparing hospitalizations across UFs or regions and when rankings are desired. However, it does not explicitly state when not to use it or name sibling alternatives such as get_hospitalizations or compare_icsap_trends, so some routing decisions are left to inference.

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