Skip to main content
Glama

DATASUS SIH/SUS — Brazil Hospital Admissions (AIH) MCP

Indicadores de ICSAP

get_icsap_indicators
Read-onlyIdempotent

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoUm estrato por linha (vazio no caminho de erro-mole)
noteNoFórmula do indicador — ou, no caminho de erro-mole, como obter o dado
errorNoMotivo pelo qual não há dados nesta resposta (ano sem dado, cobertura populacional, falha na consulta)
notesNoAvisos que qualificam os números: era CID-9, raça/cor ausente, universo do % ICSAP, denominador populacional, truncamento
truncatedNoPresente só quando `data` foi truncado no teto de linhas; os totais em `summary` são do conjunto inteiro
provenanceYesUm bloco por procedência que contribuiu com esta resposta (SIH, lista CSAP, csapAIH, população…); licenças nunca se fundem
attributionYesURLs canônicas das fontes desta resposta (lista de atribuição)
published_yearsNoAnos que o canal de cubos publica — a verdade do canal, distinta do que esta instância tem em disco; só com o cache de cubos ligado
available_sih_yearsNoAnos com dados SIH atendíveis por este servidor
years_not_availableNoPresente só quando parte dos anos pedidos não tem dado: os números cobrem apenas os anos atendidos
indicators_calculatedNoIndicadores presentes nas linhas (icsap_percentage)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint, idempotentHint, destructiveHint), the description discloses significant behavioral nuances: the universe default that excludes obstetric/long-stay admissions, the fact that race is null before 2008, and that in 1992–1997 the CID-9 list is derived and non-official with uf referring to the file's UF. These are not captured by annotations and are crucial for correct interpretation of results.

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 that front-loads the main purpose and then packs caveats and specifics. It is efficient—every sentence contributes—but the structure could be improved with bullet points or shorter sentences for readability. Still, it avoids fluff and is appropriately sized for the complexity.

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 calculation tool with an output schema, the description covers all major pitfalls: data availability by year, race grouping constraints, the universe definition, and file-based uf semantics. It also references notes for further details. Nothing essential for an agent to call the tool correctly is missing.

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 each parameter already has a description. The description adds extra semantics for group_by (race only valid from 2008) and uf (in 1992–1997 it's the file's UF), and clarifies the universe parameter's behavior in more detail than the schema, though the schema already explains the 'csapaih' vs 'all' distinction. It enriches the parameter understanding without redundancy.

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 explicitly states the tool calculates ICSAP indicators as a percentage (ICSAP/Total×100), which is a specific verb+resource. It also provides context that these are key metrics for primary care, making the purpose unambiguous. While it doesn't name a sibling tool directly, the function is clearly distinct from raw-data retrieval tools like get_icsap.

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 gives clear context on when certain groupings are valid (race only from 2008 onward) and warns about non-comparable data in 1992–1997, plus the default universe. It points to get_available_years.race_available for verification, but it does not explicitly state 'use this tool for percentages and not for raw data' or mention alternatives like compare_icsap_trends. The context is strong but lacks explicit exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.