Skip to main content
Glama

rank_csap_groups

Rank the 19 CSAP groups by hospitalizations, days, or cost to identify leading preventable causes, with optional filters for state, sex, year, age, and universe selection.

Instructions

Gera ranking dos 19 grupos CSAP por número de internações, dias de internação ou valor. Identifica principais causas evitáveis. 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 value é nominal na moeda da época — ver as notes. Universo do pacote R csapAIH por padrão (universe): fora as internações por procedimento obstétrico, parto e longa permanência.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ufNoUFs para filtrar
sexNoFiltrar por sexo
yearNoAnos para consultar
limitNoNúmero de grupos no ranking (default: 19)
metricNoMétrica para ranking (default: n)
age_maxNoIdade máxima
age_minNoIdade mínima
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.1

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses important data quirks: the 1992–1997 ICSAP uses a derived non-official ICD-9 list, g03 and g05 are not comparable with 1998+, and `value` is nominal in the currency of the time. It also explains the default universe exclusion. It does not mention sorting order or tie-breaking, but the disclosed caveats are substantial and valuable.

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 front-loaded with the primary purpose, then presents caveats in a compact manner. It is not overly verbose and each sentence adds value. The structure is logical, starting with the main action and then detailing edge cases and defaults.

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 8 parameters, no output schema, and moderate complexity, the description covers the core purpose, key metrics, historical caveats, and universe behavior. It lacks an explicit description of the output format (e.g., ordering, ties, or the 'notes' field it references), but the schema covers limits and filters. Overall, it is sufficiently complete for an agent to call correctly, with minor gaps.

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%, so the baseline is 3. The description adds meaningful semantics for two parameters: it clarifies that `value` is nominal currency (affecting interpretation) and explains the `universe` default and what it excludes. This goes beyond the schema's brief descriptions, warranting a 4.

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 clearly states the verb ('Gera ranking'), the resource ('19 grupos CSAP'), and the metrics used (number of hospitalizations, days, or value). It also adds that it identifies main avoidable causes, distinguishing it from raw data retrieval tools like get_hospitalizations. The purpose is unambiguous and differentiated from siblings.

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 provides context about the default universe and historical caveats, but it does not explicitly state when to use this tool versus alternatives such as list_csap_groups or get_icsap. It implies usage for ranking, but no exclusions or routing guidance is given.

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