Skip to main content
Glama
SQL Server MCP Server

SQL Server MCP Server

by fanzhenddz

explain

Analyze SQL query performance using execution plans to identify bottlenecks and optimize query execution.

Instructions

Analyze SQL query performance using execution plan

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": "explain"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesSQL query to analyze

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description bears the full disclosure burden, and it leaves key behavior unstated. It does not say whether obtaining the plan actually executes the query, whether there is any cost or side effect, which SQL dialect or connected database it operates against, or whether the operation is read-only.

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

Conciseness4/5

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

A single eight-word sentence with the mechanism front-loaded and zero filler. It is efficient, though the terseness is partly why behavioral gaps remain.

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

Completeness2/5

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

With no annotations and no output schema, the description is the only source of information about behavior and results, and it does not say what the plan output looks like or in what form it returns. For a diagnostic tool whose whole value is the returned analysis, that is a real gap.

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?

Schema description coverage is 100% and there is a single required 'sql' parameter already documented as "SQL query to analyze". The description adds nothing about query length limits, whether parameters/bindings are allowed, or formatting expectations, so baseline 3 applies.

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

Purpose4/5

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

The description names a specific verb ("analyze"), a specific resource ("SQL query performance"), and the mechanism ("using execution plan"), which lets an agent tell it apart from execution siblings like query/execute. It stops short of naming or contrasting any sibling explicitly, so it sits below a 5.

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

Usage Guidelines3/5

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

Usage is only implied: an agent can infer this is the tool to reach for when it wants performance insight rather than results. There is no explicit statement of when to prefer it over query/execute, no mention of prerequisites such as a prior connect_db call, and no exclusions.

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