Skip to main content
Glama
shadow-dba

mssql-dba-mcp

by shadow-dba

Get Wait Statistics

mssql_wait_stats
Read-onlyIdempotent

Analyze SQL Server wait statistics to find top wait types, average waits, and CPU signal percentages, revealing CPU, I/O, lock, or memory bottlenecks since restart or in a live sample.

Instructions

Wait statistics: the top wait types (what the server waits on: CPU, I/O, locks, memory), each as % of all waits, with average wait and signal (CPU) %. Idle waits are excluded. sampleSeconds=0 (default): since the last restart. sampleSeconds=5: only waits during a 5-second sample, the "what is slow right now" view.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNNoNumber of wait types to return (1–100).
minWaitMsNoMinimum wait time in milliseconds for a wait type to be included.
sampleSecondsNoLive sampling window in seconds. 0 = cumulative since restart. >0 = blocks for this many seconds and reports only waits accrued during the interval; use 5 for a live "right now" snapshot (matches sp_BlitzFirst). Must be below REQUEST_TIMEOUT (default 30s) or the call times out.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so safety is covered. The description adds real behavioral context beyond that: idle waits are excluded, and the sampling mode changes the semantics of every returned number. It does not mention the blocking/timeout risk of a non-zero sample (that lives only in the schema), so a 4 rather than a 5.

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?

Front-loads what the tool returns, then the metric definitions, then the mode distinction — a sensible order. Dense but nearly every clause carries information; it is close to run-on in the metric enumeration but not wasteful.

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, the description usefully sketches the return shape (top wait types, percentage of all waits, average wait, signal %), and annotations cover the safety profile. The one gap is proximity to sibling wait/blocking diagnostics, which is left to inference.

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, and the description largely restates sampleSeconds semantics (0 = since restart, 5 = live sample). It adds a little framing value but no syntax or constraints (ranges, timeout interaction) the schema doesn't already carry, making the baseline 3 appropriate.

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?

States a specific verb and resource ('wait statistics: the top wait types'), then enumerates what is measured (CPU, I/O, locks, memory) and the returned metrics (% of all waits, average wait, signal %). An agent can distinguish this from siblings like mssql_blocking or mssql_running_requests without opening a schema.

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?

Explicitly distinguishes the two operating modes: sampleSeconds=0 for cumulative-since-restart and sampleSeconds=5 as the 'what is slow right now' view. It does not, however, say when to prefer this tool over adjacent diagnostics like mssql_blocking or mssql_top_queries, so it stops short of full when/alternative routing.

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