Run a query with SSMS-style performance stats
analyze_queryExecute a SELECT with SQL Server performance statistics to diagnose slow queries. Receive per-operator row estimates, logical/physical reads, timing, missing-index suggestions, and plan warnings.
Instructions
Execute a SELECT under SET STATISTICS XML/IO/TIME and return structured performance data: per-operator estimated vs actual rows, logical/physical reads, statement timing, missing-index suggestions, and plan warnings. Use this to explain why a query is slow. Rate limit: 30 requests per 60s, 4 concurrent; exceeding it returns an error with a retry time, so pace your calls.
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": "analyze_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A single SELECT query to analyze. | |
| maxRows | No | Max result rows to include (default 50). | |
| includePlanXml | No | Include the raw showplan XML (large). Default false. |