Skip to main content
Glama
PiyapatRag

MS SQL Server MCP Server

by PiyapatRag

mssql_get_deadlocks

Read-only

Retrieve recent deadlock events from SQL Server's system_health session, including deadlock graph XML, victim sessions, and involved queries to diagnose blocking issues.

Instructions

Retrieve recent deadlock events from the built-in system_health Extended Events session, including the full deadlock graph XML, victim sessions, and the queries involved. Source 'ring_buffer' (default, fast, recent events only) or 'file' (reads system_health .xel files, further back but slower). Supported: SQL Server 2019 (15.x), 2022 (16.x), 2025 (17.x) — all editions including Express. Requires VIEW SERVER STATE.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceNo'ring_buffer' = in-memory recent events (fast). 'file' = system_health event files (older history, slower).ring_buffer
maxEventsNoMaximum number of deadlock events to return (default: 5, max: 25)
response_formatNoResponse format (default: markdown)markdown
Behavior5/5

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

Annotations indicate read-only and non-destructive. The description expands with version support, permission requirement (VIEW SERVER STATE), and source behavior. Adds significant value beyond 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?

Concise, front-loaded with main purpose, then efficiently covers sources, version support, and permissions. Every sentence is informative with no redundancy.

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?

Given three optional parameters and no output schema, the description covers return content, version support, permission, and source behavior. Complete for a deadlock retrieval tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and parameter descriptions are already detailed. The description adds context about source trade-offs (fast vs far back) not fully captured in schema enum descriptions. Overall adds value but not critical.

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 the verb (retrieve), the resource (deadlock events from system_health session), and specifies included content (deadlock graph XML, victim sessions, queries). It distinguishes from sibling tools, none of which are about deadlocks.

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?

Provides guidance on choosing between 'ring_buffer' and 'file' sources based on recency and speed. Also mentions supported versions and required permission. Lacks explicit when-not-to-use or alternatives, but no direct sibling alternatives exist.

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/PiyapatRag/mssql-mcp-server'

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