Skip to main content
Glama
MCPg - Production-grade PostgreSQL MCP Server

MCPg - Production-grade PostgreSQL MCP Server

Walk blocking chains

walk_blocking_chains
Read-only

Reconstruct PostgreSQL lock-wait graphs to detect deadlock cycles, trace blocking paths to root blockers, and render a Mermaid flowchart of lock dependencies.

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).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "walk_blocking_chains"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
databaseNoOptional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected.

Output Schema

NameRequiredDescriptionDefault
nodesYes
pathsYes
rootsYes
cyclesYes
mermaidYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.4
    • changedInput schema / properties / database / description
      Previous value: -"Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids."New value: +"Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected."
  2. First observedv0.6.8

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so 'Read-only' merely repeats structured data. The description does add value by describing the computation performed (cycle detection, root-blocker resolution, flowchart rendering), but omits cost/limits — e.g. how the `limit` governs graph size or whether the Mermaid render is expensive on large graphs.

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?

Front-loaded with the action and scope, which is good, but the final sentence enumerating `cycles`, `paths`, `roots`, `nodes`, and `mermaid` restates the output schema verbatim, spending a full sentence on information the agent already has.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Behavior and return contents are covered, and the output schema makes the return-value enumeration redundant. The blocking gap is the undocumented `limit` parameter for a graph-walk operation where result size matters, leaving the agent unable to size the call intelligently.

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?

With only 50% schema description coverage, the description should compensate, but it mentions neither parameter. The `database` parameter is documented in the schema, while `limit` has no description anywhere — its default of 50 and its effect on cycles/paths/nodes is unexplained.

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?

Names a specific verb and resource: 'Walk and reconstruct the lock-wait graph', and enumerates the concrete sub-tasks (deadlock cycle detection, linear blocking path tracing, Mermaid rendering). An agent knows exactly what it produces. It stops short of naming how it differs from close siblings like find_blocking_chains or list_locks.

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

Usage Guidelines2/5

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

No when-to-use or when-not-to-use guidance, and no reference to alternatives. Given the sibling set contains find_blocking_chains and list_locks, which overlap heavily with this tool's lock-wait investigation domain, an agent is left to guess which one to pick.

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

Deploy Server

Other Tools