Skip to main content
Glama
blimyj

mssql-mcp

by blimyj

Run a query with SSMS-style performance stats

analyze_query

Execute 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA single SELECT query to analyze.
maxRowsNoMax result rows to include (default 50).
includePlanXmlNoInclude the raw showplan XML (large). Default false.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses rate limits (30 per 60s, 4 concurrent), the error behavior on exceeding them, and the nature of returned data (plan warnings, missing indexes, I/O stats). It implies read-only behavior via SELECT, which is sufficient for this tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core function and followed by a concise use case and rate-limit warning. Every sentence earns its place with no unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema, the description enumerates the key return data (estimated vs actual rows, logical/physical reads, timing, missing-index suggestions, plan warnings). It also covers rate limits and execution scope, making it complete for an agent to select and invoke the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides full descriptions for all three parameters (sql, maxRows, includePlanXml) with 100% coverage. The description adds no additional parameter semantics beyond what the schema already states, so the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes a SELECT with SET STATISTICS and returns structured performance data including per-operator rows, reads, timing, missing-index suggestions, and plan warnings. This specific focus on performance diagnostics distinguishes it from the sibling query tool, making its purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use this to explain why a query is slow,' which provides a clear use case. It does not explicitly contrast with the query sibling, but the performance-analysis angle implies it is for diagnostics rather than general execution. The SELECT-only constraint is also mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/blimyj/mssql-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server