Skip to main content
Glama
devopam

MCPg - Production-grade PostgreSQL MCP Server

Walk blocking chains

walk_blocking_chains
Read-only

Walk the lock-wait graph to detect deadlock cycles and trace blocking chains to root blockers, producing a Mermaid flowchart for visualization.

Instructions

Walk and reconstruct the lock-wait graph of the database. Detects deadlock cycles, traces linear blocking paths to their root blockers, and renders a Mermaid flowchart representing the lock dependency graph. Read-only. Returns an object with cycles (list of detected cycle PID lists), paths (linear blocking paths as PID lists), roots (root blocker PIDs), nodes (dict keyed by PID with per-backend lock detail), and mermaid (the pre-rendered flowchart string).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
databaseNoOptional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodesYes
pathsYes
rootsYes
cyclesYes
mermaidYes
Behavior4/5

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

Annotations provide readOnlyHint and openWorldHint. The description adds context by detailing what the tool does (detect cycles, trace paths) and specifies the full structure of the returned object (cycles, paths, roots, nodes, mermaid). No contradiction 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.

Conciseness4/5

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

The description is well-structured, starting with the primary action then listing details. It is reasonably concise, though it could be slightly tighter without losing clarity.

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?

The tool is simple (2 optional params) and the description fully explains the return value structure (cycles, paths, roots, nodes, mermaid). With an output schema (assumed), the description is complete and leaves no ambiguity about the response.

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

Parameters2/5

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

Schema description coverage is 50% (only 'database' is described, but 'limit' is not). The description does not mention either parameter, so it adds no additional meaning beyond what the schema provides. Given the gap, the description should have compensated but did not.

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 clearly states the tool walks and reconstructs the lock-wait graph, detects deadlocks, and traces blocking paths. It uses specific verbs and a distinct resource, but does not explicitly differentiate from the sibling tool 'find_blocking_chains', which likely has a similar purpose.

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 usage for analyzing blocking chains and deadlocks, and explicitly labels it as read-only. However, it does not specify when to use this tool versus alternatives like 'find_blocking_chains', nor does it provide when-not-to-use guidance.

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/devopam/MCPg'

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