sns_query_dataset
Run an ODSQL query on any SNS Transparency portal dataset (Opendatasoft Explore API v2.1).
Use after sns_search_datasets for anything the curated tools don't cover. Clauses are ODSQL:
where:
instituicao like "santa maria" and tempo >= date'2026-01-01'(likeis a case- and accent-insensitive "contains"; dates use date'YYYY-MM-DD')select:
tempo, instituicao, total_urgenciasor aggregatessum(total_urgencias) as totalgroup_by:
regiaoortempo(combine with aggregates in select)order_by:
tempo descMost hospital-activity datasets (fieldtempo, monthly) store YEAR-TO-DATE CUMULATIVE values: December is the annual total; a single month = this month minus the previous one. Many datasets have aregiaoand aninstituicao(orentidade) field. Official statistics, not live data.
Args: dataset_id: e.g. "ocupacao-do-internamento" (from sns_search_datasets). where, select, group_by, order_by: ODSQL clauses (optional). limit: Rows to return (default 20, max 100). offset: Skip rows, for paging.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"dataset_id": "<dataset_id>"
},
"name": "sns_query_dataset"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| where | No | ||
| offset | No | ||
| select | No | ||
| group_by | No | ||
| order_by | No | ||
| dataset_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||