query
Executes T-SQL against configured SQL Server connections, returning JSON result sets; reads roll back automatically, while writes require approval in the broker window before commit.
Instructions
Run SQL on a connection (today every connection is SQL Server: T-SQL).
Reads (SELECT/WITH...): run inside a transaction that is always rolled back.
Writes (INSERT/UPDATE/DELETE/MERGE/DDL/EXEC...): the user must approve them in the broker window (this may take a while). They are committed only if approved and successful. Returns JSON with one or more result sets: {columns, rows, truncated} or {rowcount}.
Args: sql: T-SQL batch (no GO). connection: connection name; omit for the default one (see list_connections). max_rows: maximum rows per result set (the broker enforces its own cap).
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": "query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| max_rows | No | ||
| connection | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |