Skip to main content
Glama

Anos disponíveis e frescor dos cubos

get_available_years
Read-onlyIdempotent

Retrieves available years from SIH-SUS hospital data, including data freshness and per-year attributes like race availability, CID revision, and municipality coverage.

Instructions

Retorna os anos disponíveis nos dados do SIH-SUS carregados e o frescor dos cubos em relação ao espelho healthbr-data (freshness.status: current, stale, unknown, pending ou disabled; quando stale, lista por ano as partições reeditadas pelo MS, regeneradas, retiradas ou novas na janela). Por ano, o que muda entre as eras do SIH: race_available (raça/cor só de 2008), cid_revision (9 = CID-9 de 6 dígitos em 1992–1997, 10 = CID-10; 1997 tem as duas), icsap_list_revision (cid9-derivada, não oficial, em 1992–1997), uf_basis (arquivo em 1992–1997, residencia de 1998), municipality_available, currency e records_date_imputed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteNoAviso sobre o que `years` significa
errorNoFalha ao listar os anos
yearsNoAnos com cubos Parquet presentes localmente
currencyNoMoeda de `value` — chave é o ano (string)
uf_basisNoBase do eixo `uf` — chave é o ano (string)
freshnessNoFrescor dos cubos locais frente ao espelho healthbr-data
data_rangeNoIntervalo dos anos locais
provenanceYesBloco de proveniência (contrato v1.0): fonte, URL, competência, extração e licença
years_cid9NoAnos em que o cubo usa CID-9 (1992–1997)
attributionYesURLs canônicas das fontes desta resposta (lista de atribuição)
cid_revisionNoInternações por revisão da CID — chave é o ano (string)
csap_universeNoUniverso do % ICSAP — chave é o ano (string)
cubes_channelNoCanal público dos cubos e cache local
race_availableNoRaça/cor disponível — chave é o ano (string)
icsap_availableNoICSAP disponível — chave é o ano (string)
population_yearsNoCobertura dos arquivos de população por UF: o que as ferramentas de taxa aceitam
years_uf_arquivoNoAnos em que `uf` é a do estabelecimento (1992–1997)
years_without_raceNoAnos sem raça/cor (1998–2007)
icsap_list_revisionNoLista ICSAP por revisão da CID — chave é o ano (string)
records_date_imputedNoDatas imputadas — chave é o ano (string)
municipality_availableNoMunicípio disponível — chave é o ano (string)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.17.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "anyOf": [
      +    {
      +      "required": [
      +        "years",
      +        "data_range",
      +        "note",
      +        "race_available",
      +        "years_without_race",
      +        "cid_revision",
      +        "years_cid9",
      +        "icsap_available",
      +        "icsap_list_revision",
      +        "uf_basis",
      +        "years_uf_arquivo",
      +        "municipality_available",
      +        "currency",
      +        "records_date_imputed",
      +        "csap_universe",
      +        "population_years",
      +        "cubes_channel",
      +        "freshness"
      +      ]
      +    },
      +    {
      +      "required": [
      +        "error",
      +        "years"
      +      ]
      +    }
      +  ],
      +  "description": "Anos com cubo local, o que cada ano carrega (revisão da CID, raça/cor, município, moeda, universo ICSAP), cobertura da população, canal de cubos e frescor",
      +  "properties": {
      +    "attribution": {
      +      "description": "URLs canônicas das fontes desta resposta (lista de atribuição)",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "cid_revision": {
      +      "additionalProperties": {
      +        "additionalProperties": {
      +          "description": "Internações naquela revisão; null quando o sidecar não traz o total",
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "description": "Revisão da CID (\"9\" ou \"10\") → internações",
      +        "type": "object"
      +      },
      +      "description": "Internações por revisão da CID — chave é o ano (string)",
      +      "type": "object"
      +    },
      +    "csap_universe": {
      +      "additionalProperties": {
      +        "additionalProperties": false,
      +        "description": "Universo do % ICSAP como o csapAIH; null em cubo anterior ao builder 2.6.0",
      +        "properties": {
      +          "excluded": {
      +            "additionalProperties": {
      +              "description": "Internações fora do universo por este motivo",
      +              "type": "number"
      +            },
      +            "description": "Motivo de exclusão → internações",
      +            "type": "object"
      +          },
      +          "method": {
      +            "description": "Método (csapAIH)",
      +            "type": "string"
      +          },
      +          "records_in_universe": {
      +            "description": "Internações dentro do universo",
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "method",
      +          "records_in_universe",
      +          "excluded"
      +        ],
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      },
      +      "description": "Universo do % ICSAP — chave é o ano (string)",
      +      "type": "object"
      +    },
      +    "cubes_channel": {
      +      "additionalProperties": false,
      +      "description": "Canal público dos cubos e cache local",
      +      "properties": {
      +        "base_url": {
      +          "description": "URL do canal público de cubos",
      +          "type": "string"
      +        },
      +        "cache_dir": {
      +          "description": "Pasta do cache local; null quando desligado",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "enabled": {
      +          "description": "false quando o cache de cubos está desligado",
      +          "type": "boolean"
      +        },
      +        "manifest_generated_at": {
      +          "description": "Quando o manifesto foi gerado; null sem manifesto",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "manifest_source": {
      +          "description": "De onde veio o manifesto",
      +          "enum": [
      +            "remote",
      +            "disk",
      +            "none",
      +            "disabled"
      +          ]
      +        },
      +        "note": {
      +          "description": "Como o cache baixa os anos pedidos",
      +          "type": "string"
      +        },
      +        "published_years": {
      +          "description": "Anos publicados no manifesto do canal",
      +          "items": {
      +            "type": "number"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "enabled",
      +        "base_url",
      +        "published_years",
      +        "cache_dir",
      +        "manifest_source"
      +      ],
      +      "type": "object"
      +    },
      +    "currency": {
      +      "additionalProperties": {
      +        "description": "Moeda de `value` por competência; null quando o sidecar não informa",
      +        "items": {
      +          "additionalProperties": false,
      +          "properties": {
      +            "code": {
      +              "description": "Código ISO 4217 (BRE, BRR, BRL)",
      +              "type": "string"
      +            },
      +            "from": {
      +              "description": "Primeira competência (AAAA-MM)",
      +              "type": "string"
      +            },
      +            "name": {
      +              "description": "Nome da moeda",
      +              "type": "string"
      +            },
      +            "symbol": {
      +              "description": "Símbolo (Cr$, CR$, R$)",
      +              "type": "string"
      +            },
      +            "to": {
      +              "description": "Última competência (AAAA-MM)",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "from",
      +            "to",
      +            "code",
      +            "symbol",
      +            "name"
      +          ],
      +          "type": "object"
      +        },
      +        "type": [
      +          "array",
      +          "null"
      +        ]
      +      },
      +      "description": "Moeda de `value` — chave é o ano (string)",
      +      "type": "object"
      +    },
      +    "data_range": {
      +      "additionalProperties": false,
      +      "description": "Intervalo dos anos locais",
      +      "properties": {
      +        "first_year": {
      +          "description": "Primeiro ano local; ausente quando não há cubo",
      +          "type": "number"
      +        },
      +        "last_year": {
      +          "description": "Último ano local; ausente quando não há cubo",
      +          "type": "number"
      +        },
      +        "total_years": {
      +          "description": "Quantos anos",
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "total_years"
      +      ],
      +      "type": "object"
      +    },
      +    "error": {
      +      "description": "Falha ao listar os anos",
      +      "type": "string"
      +    },
      +    "freshness": {
      +      "additionalProperties": false,
      +      "description": "Frescor dos cubos locais frente ao espelho healthbr-data",
      +      "properties": {
      +        "checked_at": {
      +          "description": "Instante (UTC) da última checagem; null se nunca terminou",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "cubes": {
      +          "description": "Cubos atrasados frente ao espelho",
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "behind": {
      +                "description": "true quando alguma lista acima tem item",
      +                "type": "boolean"
      +              },
      +              "cube_year": {
      +                "description": "Ano do cubo",
      +                "type": "number"
      +              },
      +              "new_in_window": {
      +                "description": "Competências publicadas depois do build",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "reedited": {
      +                "description": "Partições cujo .dbc de origem mudou (reedição do MS)",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "removed": {
      +                "description": "Partições que saíram do manifesto",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "reprocessed": {
      +                "description": "Partições regeneradas pelo espelho",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              }
      +            },
      +            "required": [
      +              "cube_year",
      +              "reedited",
      +              "reprocessed",
      +              "removed",
      +              "new_in_window",
      +              "behind"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "error": {
      +          "description": "Erro da checagem; null quando não houve",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "manifest_last_updated_local": {
      +          "description": "Manifesto com que os cubos foram gerados",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "manifest_last_updated_remote": {
      +          "description": "Manifesto público lido agora",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "manifest_url": {
      +          "description": "URL do manifesto do espelho",
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "method": {
      +          "description": "Como checou: sonda parcial ou manifesto inteiro",
      +          "enum": [
      +            "range",
      +            "full",
      +            null
      +          ]
      +        },
      +        "status": {
      +          "description": "Frescor dos cubos frente ao espelho",
      +          "enum": [
      +            "disabled",
      +            "pending",
      +            "current",
      +            "stale",
      +            "unknown"
      +          ]
      +        }
      +      },
      +      "required": [
      +        "status",
      +        "checked_at",
      +        "method",
      +        "manifest_url",
      +        "manifest_last_updated_local",
      +        "manifest_last_updated_remote",
      +        "cubes",
      +        "error"
      +      ],
      +      "type": "object"
      +    },
      +    "icsap_available": {
      +      "additionalProperties": {
      +        "description": "true quando o cubo tem a marcação ICSAP",
      +        "type": "boolean"
      +      },
      +      "description": "ICSAP disponível — chave é o ano (string)",
      +      "type": "object"
      +    },
      +    "icsap_list_revision": {
      +      "additionalProperties": {
      +        "additionalProperties": {
      +          "description": "Lista usada (portaria-221-2008 ou cid9-derivada)",
      +          "type": "string"
      +        },
      +        "description": "Revisão → lista",
      +        "type": "object"
      +      },
      +      "description": "Lista ICSAP por revisão da CID — chave é o ano (string)",
      +      "type": "object"
      +    },
      +    "municipality_available": {
      +      "additionalProperties": {
      +        "description": "false quando `municipality_code` é nulo em todas as linhas",
      +        "type": "boolean"
      +      },
      +      "description": "Município disponível — chave é o ano (string)",
      +      "type": "object"
      +    },
      +    "note": {
      +      "description": "Aviso sobre o que `years` significa",
      +      "type": "string"
      +    },
      +    "population_years": {
      +      "additionalProperties": false,
      +      "description": "Cobertura dos arquivos de população por UF: o que as ferramentas de taxa aceitam",
      +      "properties": {
      +        "aggregated": {
      +          "additionalProperties": false,
      +          "description": "pop_uf_agregado.parquet — faixa etária quinquenal por UF e sexo (1991–1999)",
      +          "properties": {
      +            "age": {
      +              "description": "Grão etário do arquivo",
      +              "type": "string"
      +            },
      +            "age_groups": {
      +              "description": "Faixas etárias quinquenais (só no arquivo agregado)",
      +              "items": {
      +                "type": "string"
      +              },
      +              "type": "array"
      +            },
      +            "first_year": {
      +              "description": "Primeiro ano coberto",
      +              "type": "number"
      +            },
      +            "last_year": {
      +              "description": "Último ano coberto",
      +              "type": "number"
      +            },
      +            "source": {
      +              "description": "Arquivo parquet que serve o intervalo",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "first_year",
      +            "last_year",
      +            "source",
      +            "age"
      +          ],
      +          "type": [
      +            "object",
      +            "null"
      +          ]
      +        },
      +        "detailed": {
      +          "additionalProperties": false,
      +          "description": "pop_uf.parquet — idade simples por UF e sexo (projeções IBGE, 2000+)",
      +          "properties": {
      +            "age": {
      +              "description": "Grão etário do arquivo",
      +              "type": "string"
      +            },
      +            "age_groups": {
      +              "description": "Faixas etárias quinquenais (só no arquivo agregado)",
      +              "items": {
      +                "type": "string"
      +              },
      +              "type": "array"
      +            },
      +            "first_year": {
      +              "description": "Primeiro ano coberto",
      +              "type": "number"
      +            },
      +            "last_year": {
      +              "description": "Último ano coberto",
      +              "type": "number"
      +            },
      +            "source": {
      +              "description": "Arquivo parquet que serve o intervalo",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "first_year",
      +            "last_year",
      +            "source",
      +            "age"
      +          ],
      +          "type": [
      +            "object",
      +            "null"
      +          ]
      +        },
      +        "first_year": {
      +          "description": "Primeiro ano com população por UF (união dos dois arquivos)",
      +          "type": "number"
      +        },
      +        "last_year": {
      +          "description": "Último ano com população por UF",
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "first_year",
      +        "last_year",
      +        "detailed",
      +        "aggregated"
      +      ],
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "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"
      +    },
      +    "race_available": {
      +      "additionalProperties": {
      +        "description": "true quando o cubo tem raça/cor",
      +        "type": "boolean"
      +      },
      +      "description": "Raça/cor disponível — chave é o ano (string)",
      +      "type": "object"
      +    },
      +    "records_date_imputed": {
      +      "additionalProperties": {
      +        "description": "Internações que entraram com data imputada",
      +        "type": "number"
      +      },
      +      "description": "Datas imputadas — chave é o ano (string)",
      +      "type": "object"
      +    },
      +    "uf_basis": {
      +      "additionalProperties": {
      +        "description": "Base do eixo `uf`",
      +        "enum": [
      +          "residencia",
      +          "arquivo"
      +        ]
      +      },
      +      "description": "Base do eixo `uf` — chave é o ano (string)",
      +      "type": "object"
      +    },
      +    "years": {
      +      "description": "Anos com cubos Parquet presentes localmente",
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    "years_cid9": {
      +      "description": "Anos em que o cubo usa CID-9 (1992–1997)",
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    "years_uf_arquivo": {
      +      "description": "Anos em que `uf` é a do estabelecimento (1992–1997)",
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    "years_without_race": {
      +      "description": "Anos sem raça/cor (1998–2007)",
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "provenance",
      +    "attribution"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changedv0.15.4
    • addedInput schema / additionalProperties
      Added value: +false
  3. First observedv0.12.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds meaningful behavioral context by enumerating freshness.status values and describing what happens when status is stale, including per-year listing of revised, regenerated, removed, or new partitions. This goes well beyond the annotations without contradicting them.

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?

The core result is front-loaded in the first clause, and every later detail about freshness statuses and era-dependent fields is relevant to interpreting the returned data. However, the description is a dense single paragraph with many semicolons and parentheticals; bulleted structure would improve readability without adding length.

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 zero-parameter, read-only, idempotent metadata tool with an output schema, the description is complete: it covers year availability, freshness states, stale-partition behavior, and per-year era differences. No additional facts about authentication, rate limits, side effects, or parameters are necessary for an agent to select and invoke this tool 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?

The input schema has zero parameters, so there are no parameter semantics to document; the baseline for zero-parameter tools is 4. The description correctly focuses on output semantics and does not invent or omit parameter guidance.

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 the specific resource and scope: available years in the loaded SIH-SUS data plus cube freshness relative to the healthbr-data mirror. It is clearly distinct from sibling tools like get_hospitalizations or get_icsap, which retrieve data rather than metadata. The verb 'Retorna' makes the read-only retrieval intent explicit.

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 description implies when to use the tool (whenever year availability or cube freshness is needed) but gives no explicit guidance about when not to use it or which sibling alternative to prefer. There are no exclusions, preconditions, or alternative routing statements, so usage guidance is only inferred from the stated purpose.

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