Requests running now and who blocks them
get_active_requestsShows currently running requests with status, waits, and blocking chains so you can diagnose slow or stuck SQL Server sessions.
Instructions
Shows what runs in this database now: each request of a user session but this tool's own, with its status, command, start and elapsed time, CPU and reads, the current wait and the resource it waits on (for a parallel request, the blocked worker's), with the table and index where the catalog names them, the session blocking it, open transactions and when the oldest began, degree of parallelism, memory grant, the procedure and the current statement (300 characters), query_hash, and the plan_handle with the statement's offsets for get_query_plan_summary; plus each chain of blocking up to its head, the session that blocks without being blocked, which can be idle with a transaction left open, or in another database, with the last batch it sent. Use it when something is slow or stuck right now; for what ran before use find_cached_queries or the Query Store tools, such as find_query_store_queries. It shows other sessions' login, host name, program and SQL text, which can carry literal values. Needs VIEW SERVER STATE (2022+: VIEW SERVER PERFORMANCE STATE): without it SQL Server shows a login its own session alone, so the call fails, naming the GRANT that adds it or the DENY that refuses it, rather than report nothing running.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"database": "<database>"
},
"name": "get_active_requests"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Most requests to list, the longest running first (default 50, at most 200). The blocking chains cover every request of the database, whatever the limit. | |
| database | Yes | Name of the database as registered in the configuration. |