Skip to main content
Glama

get_icsap_indicators

Calculates ICSAP indicators as a percentage of hospitalizations for primary care-sensitive conditions, with optional filters for UF, year, sex, age, and grouping dimensions.

Instructions

Calcula indicadores de ICSAP: percentual (ICSAP/Total×100). Métricas-chave para avaliar a Atenção Primária. Agrupar por raça só faz sentido de 2008 em diante: em 1998–2007 race é nulo (ver get_available_years.race_available). Em 1992–1997 a ICSAP vem de lista CID-9 DERIVADA e não oficial (g03 e g05 não comparáveis com 1998+) e uf é a UF do arquivo — ver 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 calcular
sexNoFiltrar por sexo
yearNoAnos para calcular
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.
municipality_codeNoCódigo IBGE do município

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.1

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are provided, so the description must carry the full burden. It discloses that the default universe excludes obstetric procedures, childbirth, and long-stay hospitalizations, and notes that UF in 1992-1997 refers to the file's UF. It also warns about comparability issues across years. These are critical behavioral details.

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 description is dense but well-organized. It leads with the core calculation, then flows into year-specific caveats and the universe default. Each sentence adds value; no fluff. It's appropriately sized for the tool's complexity.

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?

For a tool with 8 parameters, no output schema, and no annotations, the description covers the most critical aspects: the calculation formula, default behavior, and critical data caveats. It also references get_available_years for further details. However, it doesn't describe the output format or how to interpret results, which could be a gap.

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%, but the description adds meaningful context beyond the schema. It explains the 'universe' parameter's default and what it excludes, and warns about 'race' parameter validity only from 2008. This is genuinely useful guidance that the schema alone doesn't provide.

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 the exact purpose: 'Calcula indicadores de ICSAP: percentual (ICSAP/Total×100)' with a clear verb and resource. It distinguishes itself from siblings like get_icsap (which likely returns raw counts) by focusing on the percentage indicator, and mentions key metrics for primary care evaluation.

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

Usage Guidelines4/5

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

Provides explicit usage constraints: grouping by race only from 2008 onward, year-specific caveats (1992-1997 non-official CID-9 list), and default universe behavior. References get_available_years for race availability. While it doesn't explicitly name alternatives, it gives enough context to decide when to use it.

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