run_query
Run read-only SQL queries across cached CVM tables to combine datasets, compute custom aggregates, and inspect data before writing longer queries. Use SELECT or WITH; results are row-limited.
Instructions
Run SQL across cached CVM tables (DuckDB engine).
Use it for questions that combine datasets, for aggregates the curated tools
do not expose, and to inspect a table before writing a longer query. Only
SELECT/WITH is allowed; the result is capped by limit.
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": {
"sql": "<sql>"
},
"name": "run_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A single read-only SELECT/WITH query. Views are named <dataset>__<table>, e.g. dfp__dre_con, fi_inf_diario__informe, vlmo__transacoes. Only cached periods exist. | |
| limit | No | Maximum rows returned. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |