Skip to main content
Glama
Elekto MCP for SQL Server

Elekto MCP for SQL Server

Official

Requests running now and who blocks them

get_active_requests
Read-onlyIdempotent

Shows 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

NameRequiredDescriptionDefault
topNoMost requests to list, the longest running first (default 50, at most 200). The blocking chains cover every request of the database, whatever the limit.
databaseYesName of the database as registered in the configuration.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.6.1

TDQS

A4.3/5.0
Behavior4/5

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

Well beyond the readOnly/idempotent annotations: it discloses the required permission (VIEW SERVER STATE, or VIEW SERVER PERFORMANCE STATE on 2022+) and, critically, the failure mode — without it SQL Server reports only the caller's own login, so the call fails naming the GRANT or DENY instead of silently returning nothing. It also warns that other sessions' login, host, program, and SQL text are exposed and may contain literals. The blocking-chain semantics (idle head with an open transaction, head in another database) add real diagnostic context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The key purpose is front-loaded and little of the content is filler, but the middle is one sprawling run-on clause with a long comma-separated field inventory that is hard to scan. A short list or grouped sentences would deliver the same information with less parsing effort.

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 two-parameter read tool with no output schema and no annotations covering permissions, the description supplies the permission requirement, the failure behavior, the privacy exposure, the blocking-chain model, and the handoff of plan_handle to get_query_plan_summary. An agent has everything needed to call it correctly and interpret a failure.

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 coverage is 100%, so both parameters are already documented in the schema, including the default/max of `top` and the fact that blocking chains ignore the limit. The description only restates the blocking-chain scope and adds no format, syntax, or naming detail beyond what the schema provides. Baseline 3 applies.

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 ('Shows what runs in this database now') and enumerates exactly what is returned: status, command, timings, CPU/reads, wait resource, blocking session, open transactions, DOP, memory grant, procedure/statement, query_hash, plan_handle. It explicitly carves out its sibling territory by contrasting with find_cached_queries and find_query_store_queries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'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' gives both the trigger condition and named alternatives. It also states an exclusion: the tool's own session's request is not listed.

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