Skip to main content
Glama

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

Ranking dos grupos CSAP

rank_csap_groups
Read-onlyIdempotent

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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNoSempre vazio: só aparece no caminho de erro-mole do funil
noteNoComo obter o dado (por exemplo, consultar get_available_years)
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
metricNoMétrica que ordena
rankingNoRanking em ordem decrescente da métrica
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)
total_groupsNoQuantos grupos no ranking
concentrationNo
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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, covering safety. The description adds valuable behavioral context beyond annotations: the caveat about CID-9 derived data for 1992–1997, the non-comparability of groups g03 and g05, the nominal currency of 'value', and the default universe (csapaih) that excludes obstetric procedures, childbirth, and long-stay admissions. These are important data behaviors an agent should know.

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 concise, with the main purpose stated in the first sentence and caveats following. It is not overly verbose and front-loads the core function. The structure is logical: purpose, capability, then data caveats. It could be slightly more streamlined, but it is 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?

Given the tool has 8 optional parameters, an output schema, and the annotations cover safety, the description is fairly complete. It explains the ranking criteria, the data caveats, and the default universe. It does not explicitly mention the output format (e.g., a table), but the presence of an output schema likely covers that. The description is sufficient for an agent to call the tool correctly, though it could mention potential edge cases or the direction of ranking (e.g., descending).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description does add some context, such as the meaning of the 'value' metric being nominal and the explanation of the 'universe' parameter's default behavior. However, it does not delve into other parameters like 'uf', 'sex', 'year', or 'limit' beyond what the schema already states. The added value is marginal, keeping the score at baseline.

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 a clear verb ('Gera ranking') and resource ('dos 19 grupos CSAP'), and specifies the ranking criteria (number of hospitalizations, days, or value). It also adds an additional capability ('Identifica principais causas evitáveis'). The purpose is unambiguous and distinct from sibling tools like list_csap_groups or get_icsap, which focus on listing or retrieving data rather than ranking.

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 does not explicitly state when to use this tool versus alternatives or when not to use it. It provides context about the default universe and data caveats, but these are behavioral notes, not usage guidance. An agent might infer the use case from the name, but the description lacks explicit direction on when to prefer this over get_icsap 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.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.