Skip to main content
Glama

compare_icsap_trends

Compare temporal trends of primary care-sensitive conditions across Brazilian states or groups, calculating annual variation and identifying top and bottom performers.

Instructions

Análise temporal comparativa de ICSAP entre UFs ou grupos CSAP. Calcula tendências, variação anual e identifica melhores/piores desempenhos. Para percentage e count valem todos os anos do SIH (desde 1992); rate_per_10k exige população e aceita só os anos de get_available_years.population_years. 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
end_yearYesAno final
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.
indicatorNoIndicador: percentage (% ICSAP), count (número), rate_per_10k (taxa)
compare_byNoComparar por UF ou grupo CSAP
start_yearYesAno inicial
compare_valuesNoValores específicos para comparar (UFs ou grupos CSAP)
include_trend_lineNoIncluir análise de tendência linear (default: true)

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 carries full responsibility. It transparently explains the tool's calculations (trends, variation, best/worst) and important caveats about ICD-9 derived data for 1992-1997 and the 'uf' definition. It does not detail any side effects or data source specifics beyond those notes, but for a read-only analysis tool this is adequate.

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 a single dense paragraph but is focused and necessary, covering purpose, parameter restrictions, and data caveats. It is slightly verbose but not redundant. It front-loads the purpose and then elaborates on edge cases, which is appropriate for a tool with complex data limitations.

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?

No output schema is provided, but the description states what the tool calculates (trends, annual variation, best/worst) which is sufficient for expected outputs. It mentions 'ver as notes' for additional details, which is a minor gap but not critical. Overall, it gives enough context for an agent to decide whether to invoke this tool.

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 schema covers all 7 parameters with descriptions (100% coverage). The description adds meaningful context for 'universe' (what is excluded from numerator/denominator) and 'indicator' (restrictions on rate_per_10k). It does not redefine parameters already well-described in the schema, but the additional caveats improve understanding.

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 tool's purpose: comparative temporal analysis of ICSAP between UFs or CSAP groups, including trend calculation, annual variation, and identification of best/worst performers. This specific verb-noun-resource structure distinguishes it from sibling tools.

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?

The description provides usage guidance for different indicators (percentage/count vs rate_per_10k, which requires population and only certain years) and explains the universe parameter's default behavior. It mentions get_available_years for valid years, but does not explicitly contrast with sibling tools like get_icsap_indicators or compare_regions.

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