Skip to main content
Glama

get_wait_stats

Read-onlyIdempotent

Identify database bottlenecks by retrieving top wait statistics from sys.dm_db_wait_stats, with category mapping and root-cause recommendations.

Instructions

Get top wait statistics from sys.dm_db_wait_stats with category mapping (CPU, I/O, Lock, Memory, Network, etc.), benign wait filtering, and root-cause recommendations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_nNoNumber of top waits to return.
database_nameNoOptional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE.

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 this as a safe read-only operation, and the description adds meaningful behavioral context: it performs category mapping, filters benign waits, and provides root-cause recommendations. It also names the source DMV, helping the agent understand the data scope. No contradictions with annotations.

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?

The description is a single, front-loaded sentence that efficiently conveys the main action, data source, and key features. Every clause adds useful information without redundancy or fluff.

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?

Given the tool's moderate complexity, the description covers the data source, transformations, and outputs (recommendations). The presence of an output schema and comprehensive parameter schema reduces the need for return-value explanations. It slightly lacks explicit scope (database vs instance), but the DMV name clarifies this for most users.

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?

The input schema provides 100% coverage with clear descriptions for both parameters: 'top_n' (number of waits) and 'database_name' (optional, with default). The tool description does not add additional parameter-level detail, but the schema already handles this, so baseline 3 is appropriate.

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 specifies a clear action ('Get top wait statistics') and resource ('sys.dm_db_wait_stats'), with detailed scope including category mapping and filtering. However, it does not differentiate from the sibling tool 'get_query_wait_stats', which likely offers a different granularity (query-level vs database-level), so it lacks explicit sibling differentiation.

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?

The description implies its use case—diagnosing wait stats with category mapping and recommendations—but does not provide explicit when-to-use or when-not-to-use guidance, nor does it mention alternatives like 'get_query_wait_stats' or 'get_currently_waiting_tasks'. Usage context is implied rather than stated.

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