Execute Read-Only SQL
execute_sqlExecute a read-only SQL SELECT query against the Compabase database. Use when dedicated tools are not enough (aggregations, joins, custom analysis). Returns at most row_limit rows per call depending on the plan (Free 100, Pro 500, Scale 1000); if truncated is true, the full result is larger and fits better as an aggregate inside SQL (GROUP BY, COUNT, AVG, percentile_cont).
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": {
"query": "<query>"
},
"name": "execute_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | A read-only SQL SELECT or WITH…SELECT statement. |