Skip to main content
Glama

get_icsap

Query primary care-sensitive hospitalization (ICSAP) data with filters for year, UF, municipality, sex, race, age, and CSAP group.

Instructions

Consulta internações por Condições Sensíveis à Atenção Primária (ICSAP). Permite filtros por grupo CSAP, UF, município, sexo, idade e raça. Raça/cor só existe de 2008 em diante: em 1998–2007 race é nulo (ver get_available_years.race_available). Série desde 1992: em 1992–1997 a ICSAP vem de lista CID-9 DERIVADA e não oficial (g03 e g05 não comparáveis com 1998+), uf é a UF do arquivo e municipality_code é nulo — ver get_available_years (icsap_list_revision, uf_basis) e as notes. Percentual no universo do pacote R csapAIH por padrão (universe): fora do numerador e do denominador as internações por procedimento obstétrico, parto e longa permanência.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoUFs para filtrar
sexNoFiltrar por sexo
raceNoRaça/cor (branca, preta, parda, amarela, indigena, ignorado). Só existe de 2008 em diante: em 1998–2007 race é nulo e o filtro não alcança esses anos.
yearNoAnos para consultar
age_maxNoIdade máxima
age_minNoIdade mínima
group_byNoDimensões para agrupamento
universeNoUniverso do % ICSAP: 'csapaih' (padrão) tira do numerador e do denominador as internações por procedimento obstétrico, com diagnóstico de parto (O80-O84) e as AIH de longa permanência, como o pacote R csapAIH (Nedel); 'all' conta todas as internações.
csap_groupNoGrupos CSAP (ex: ['g01', 'g05'])
municipality_codeNoCódigo IBGE do município (6 dígitos)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.1

TDQS

B3.4/5.0
Behavior4/5

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

The description exposes important behavioral nuances: race is absent for 1998–2007, municipality_code is null for 1992–1997, and the default universe for percentage calculation excludes obstetric and long-stay hospitalizations. These details go beyond the basic schema and help set expectations, though the return format is not explicitly stated.

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

Conciseness3/5

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

The description is a single dense paragraph that packs many caveats (race availability, series revision, universe definition) without clear structure or bullet points. While the information is relevant, it could be more organized for quick agent consumption.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description hints at output by mentioning percentages but does not explain the return format, grouping behavior, or whether the result is aggregated by group_by. Without an output schema, this missing information leaves the agent to infer the response structure.

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?

Every parameter has a Portuguese description that adds context beyond the schema's types and enums. For example, the race parameter explains the temporal limitation, and the universe parameter clarifies the default behavior. This goes beyond the baseline schema coverage, providing meaningful semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool queries hospitalizations for CSAP (ambulatory care sensitive conditions) and lists filter options. However, it does not explicitly distinguish this from similar sibling tools like get_hospitalizations or get_icsap_indicators, which slightly reduces clarity.

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

Usage Guidelines2/5

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

The description does not provide guidance on when to use this tool versus the many sibling tools. It references get_available_years for additional details on data limitations, but does not explain scenarios where this tool is preferred over alternatives such as get_icsap_indicators or compare_icsap_trends.

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