execute_query
Run SQL against a configured connection and get paginated tabular, JSON, or raw results. Page through large result sets with offset and maxRows, and reuse the last result via CSV or JSON resources.
Instructions
Execute a SQL query. Results are paginated: at most maxRows rows are returned per call. When the response reports hasMore, call again with offset=nextOffset to fetch the next page. Each page re-executes the query (offset pagination), so paging an expensive query repeats its cost. The most recent result per connection is also exposed as query-result://{connectionId}/csv and query-result://{connectionId}/json resources.
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": {
"connectionId": "<connectionId>",
"sql": "<sql>"
},
"name": "execute_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL query | |
| format | No | Output format | |
| offset | No | Rows to skip before returning results (default 0); use nextOffset from a truncated response to fetch the next page | |
| maxRows | No | Max rows to return per page | |
| timeout | No | Query timeout in ms | |
| connectionId | Yes | Connection ID |