query
Run a guarded read-only SELECT or WITH query against a saved profile to get columns and rows, with row and time limits enforced and writes refused.
Instructions
Run one read-only SELECT (or WITH ... SELECT) on a profile and get columns and rows. Aggregate in SQL (GROUP BY, TOP/LIMIT) instead of fetching raw rows: results stop at the profile's row limit (500 unless the user changed it), cells at 2 KB, and truncated: true means the answer is partial. Writes, EXEC, multiple statements and functions with side effects are refused; quote a column named like an SQL keyword. SQL Server reads uncommitted data, like the health check: counts and sums taken while other transactions are open can be off, so present them as approximate, not final.
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": {
"profile": "<profile>",
"sql": "<sql>"
},
"name": "query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | one SELECT or WITH ... SELECT statement | |
| profile | Yes | profile name from list_profiles | |
| database | No | database name from list_databases; default: the profile's | |
| max_rows | No | row limit; default and ceiling: the profile's | |
| timeout_s | No | seconds; default and ceiling: the profile's |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| rows | Yes | ||
| columns | Yes | ||
| warning | No | ||
| truncated | Yes | ||
| elapsed_ms | Yes |