mssql_run_query
Executes T-SQL queries against an active connection and returns compact CSV or JSON; in default read-only mode, write, DDL, and EXEC statements are blocked.
Instructions
Executes a T-SQL query against an active connectionId and returns compact CSV (default) or JSON. In --readonly mode (default), write/DDL/EXEC statements are blocked.
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>",
"query": "<query>"
},
"name": "mssql_run_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The T-SQL query to execute. | |
| format | No | Output format: 'csv' (default) or 'json'. | csv |
| queryTypes | No | Optional query classification (e.g. SELECT, DDL, DML). | |
| queryIntent | No | Brief intent description for audit logging. | |
| connectionId | Yes | The connectionId returned by mssql_connect. |