Skip to main content
Glama
deepeshd87

mcp-sql-querystore

by deepeshd87

analyze_parameter_sniffing

Detect parameter sniffing by identifying queries with multiple compiled plans and widely varying runtimes, ranked by slowest-to-fastest plan ratio.

Instructions

Detect queries whose runtime varies widely across multiple compiled plans — the classic parameter-sniffing signature. Ranks by the ratio of slowest to fastest plan mean duration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNoMax rows to return.
database_nameYesTarget SQL Server database name.
min_plan_countNoMinimum distinct plans for a query to be considered (2 = at least two plans).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses the ranking mechanism (slowest-to-fastest plan mean duration ratio) and implicitly that this is a read/analysis operation, but says nothing about permissions, whether it is read-only, cost, or result shape.

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 tight sentences, front-loaded with the detection target followed by the ranking rule. No filler.

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

Completeness3/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 partially compensates by describing the ranking metric. However, it omits usage context, read-only status, and any sense of output columns, leaving meaningful gaps for a diagnostic 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 database_name, top_n, and min_plan_count are already documented in the schema. The description adds no parameter syntax or defaults beyond what the schema states; 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?

States a specific verb+resource: detecting queries whose runtime varies across compiled plans, and names the phenomenon (parameter sniffing). It also gives the ranking criterion. It does not explicitly differentiate itself from get_regressed_queries or sweep_regressions, which is the only gap.

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?

No guidance on when to reach for this tool vs. get_regressed_queries, sweep_regressions, or get_query_execution_plan. The description implies a diagnostic context but never states prerequisites or exclusions.

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