Skip to main content
Glama

analyze_locks

Read-only

Reports PostgreSQL lock waits in progress, showing blocked and blocking sessions, lock type, wait duration, and chain hops from a read-only snapshot without terminating anything.

Instructions

Reports the lock waits in progress: which sessions are blocked, which sessions block them, through how many hops, on which lock and for how long. Read-only diagnosis of a single snapshot: it never cancels or terminates anything.

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": "analyze_locks"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, and openWorldHint=false; the description adds genuinely new behavior beyond them by clarifying it never cancels or terminates blocking sessions and that results represent one point-in-time snapshot rather than a live monitor. It stops short of naming the permission level required to see other sessions' lock state.

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?

Two sentences with no filler: the first front-loads what is reported and enumerates the fields, the second immediately bounds the behavior with the snapshot and no-mutation guarantees.

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

Completeness4/5

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

With no parameters and no output schema, the description carries the burden of describing the return shape, and it does so by naming the reported fields. The main missing piece for a lock-diagnosis tool is that the agent does not know what privileges are required to see other sessions' wait chains.

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?

The tool takes no parameters, so the schema leaves nothing to explain and the baseline is 4. The description correctly describes the call as taking scope-free snapshot input by omission rather than adding anything misleading.

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 (reports) and resource (lock waits in progress) and then enumerates the exact dimensions reported: blocked sessions, blocking sessions, hop depth, lock identity, and duration. This is specific enough that an agent can distinguish it from analyze_db_health or explain_query without opening the schema.

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?

Framed as 'read-only diagnosis of a single snapshot,' which implies the diagnostic use case, but there is no explicit when-to-use vs. siblings (e.g., versus get_top_queries or explain_query) and no stated prerequisites such as the privileges needed to observe other sessions' locks.

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