Skip to main content
Glama
deepeshd87

mcp-sql-querystore

by deepeshd87

get_query_execution_plan

Fetch execution plans for a Query Store query ID to diagnose performance issues, returning missing indexes, warnings, lookups, and optional raw XML.

Instructions

Fetch execution plan(s) for a Query Store query_id and return a compact summary (missing indexes, warnings, lookups) plus optional raw XML.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
query_idYesQuery Store Query ID.
include_xmlNoInclude raw showplan XML alongside summary.
database_nameYesTarget SQL Server database name.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It implies a read-only fetch and discloses the return shape (compact summary plus optional raw XML), which is useful. However, it omits permission requirements, the cost/latency of pulling showplan XML, and whether multiple plans may be returned (the '(s)' hints at it but never resolves).

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?

A single front-loaded sentence that states the operation, the input scope, and the return payload with zero filler. Nothing could be removed without losing information.

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

Completeness4/5

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

With no output schema and no annotations, the description does a fair job of specifying what is returned (missing indexes, warnings, lookups, optional XML). It lacks operational caveats -- permissions, Query Store availability, and the multi-plan ambiguity from '(s)' -- but is otherwise sufficient for a read-only introspection tool.

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%, so all three parameters are already documented in the schema. The description adds only marginal meaning -- 'optional raw XML' maps to include_xml defaulting to false, and query_id is referenced as Query Store-specific. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

Names a specific verb (Fetch) and resource (execution plan(s)) scoped to a Query Store query_id, and states what comes back (missing indexes, warnings, lookups, optional XML). It is clearly distinguishable from siblings like get_wait_stats or analyze_parameter_sniffing, though it never explicitly contrasts itself with them -- notably get_missing_index_impact, which overlaps on missing-index output.

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

Usage Guidelines2/5

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

The description gives no when-to-use guidance, no prerequisites (e.g. Query Store must be enabled, database must be online), and no routing advice against the overlapping get_missing_index_impact sibling. Usage is only implied by the query_id parameter.

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