Skip to main content
Glama

get_query_wait_stats

Read-onlyIdempotent

Retrieve per-query wait stats from Query Store to diagnose slow queries. Identify which wait types affect each query, revealing the exact reason for performance issues.

Instructions

Get per-query wait breakdown from Query Store wait stats. Ties waits to specific queries: 'this query is slow because of X'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNoNumber of top results.
database_nameNoOptional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE.
window_minutesNoQuery Store lookback window in minutes.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, establishing the safe read-only nature. The description adds meaningful context by identifying the data source (Query Store wait stats) and explaining the output's per-query granularity. This goes beyond the annotations without contradicting them.

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 purpose and immediately followed by a practical example. No wasted words; every sentence earns its place.

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?

For a read-only diagnostic tool with a rich output schema and comprehensive annotations, the description fully explains the tool's purpose and value. It distinguishes the tool from siblings and provides enough context for a agent to select it appropriately. The presence of an output schema means return-value details need not be repeated in the description.

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 the baseline is 3. The description's reference to 'per-query wait breakdown' adds high-level context to interpret parameters like top_n and window_minutes, but it doesn't provide specific parameter syntax or format details beyond what the schema already documents. The description earns its place without repeating schema details.

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 a specific verb ('Get') and resource ('per-query wait breakdown from Query Store wait stats'). It explicitly differentiates from sibling tools like get_wait_stats by emphasizing 'per-query' and 'ties waits to specific queries', making the tool's unique purpose unmistakable.

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 provides clear context on when to use the tool: to understand why a specific query is slow due to waits ('this query is slow because of X'). While it doesn't explicitly name alternatives or exclusions, the 'per-query' framing implicitly distinguishes it from aggregate wait-stats tools. This is clear guidance, though not as explicit as naming sibling alternatives.

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/akaalholdings/azure-sql-mcp'

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