Skip to main content
Glama
call518

MCP PostgreSQL Operations

get_lock_monitoring

Monitor current locks and identify blocked sessions in PostgreSQL databases to diagnose lock contention and prevent deadlocks.

Instructions

[Tool Purpose]: Monitor current locks and potential deadlocks in PostgreSQL

[Exact Functionality]:

  • List all current locks held and waited for by sessions

  • Show blocked and blocking sessions, lock types, and wait status

  • Help diagnose lock contention and deadlock risk

  • Filter results by granted status, state, mode, lock type, or username

[Required Use Cases]:

  • When user requests "lock monitoring", "deadlock check", "blocked sessions", etc.

  • When diagnosing performance issues due to locking

  • When checking for blocked or waiting queries

  • When filtering specific types of locks or users

[Strictly Prohibited Use Cases]:

  • Requests for killing sessions or force-unlocking

  • Requests for lock configuration changes

  • Requests for historical lock data (only current state is shown)

Args: database_name: Database name to analyze (uses default database if omitted) granted: Filter by granted status ("true" or "false") state: Filter by session state ("active", "idle", "idle in transaction", etc.) mode: Filter by lock mode ("AccessShareLock", "ExclusiveLock", etc.) locktype: Filter by lock type ("relation", "transactionid", "virtualxid", etc.) username: Filter by specific username

Returns: Table-format information showing PID, user, database, lock type, relation, mode, granted, waiting, and blocked-by info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_nameNo
grantedNo
stateNo
modeNo
locktypeNo
usernameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it's a read-only monitoring tool (implied by 'list', 'show', 'diagnose'), shows only current state (not historical data), and returns table-format information. It doesn't mention rate limits, authentication needs, or performance impact, but covers the core functionality well given the annotation gap.

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 with clear sections (Tool Purpose, Exact Functionality, etc.), making it easy to scan. It's appropriately sized for a 6-parameter tool with no annotations, though some redundancy exists (e.g., 'Filter results by...' in Exact Functionality and again in Args). Every sentence adds value, but minor trimming could improve conciseness.

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?

Given the tool's complexity (6 parameters, 0% schema coverage, no annotations) and the presence of an output schema (implied by 'Returns: Table-format information...'), the description is highly complete. It covers purpose, usage guidelines, behavioral context, parameter semantics, and return format, leaving no significant gaps for the agent to operate effectively.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It provides a detailed 'Args' section that explains each parameter's purpose (e.g., 'Filter by granted status', 'Filter by specific username'), adding essential meaning beyond the bare schema. This is crucial for the 6 parameters with no schema descriptions.

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?

The description explicitly states the tool's purpose in the first line: 'Monitor current locks and potential deadlocks in PostgreSQL.' It provides specific verbs ('list', 'show', 'diagnose', 'filter') and clearly distinguishes this tool from siblings by focusing exclusively on lock monitoring, unlike other tools that handle connections, tables, replication, etc.

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?

The description includes dedicated sections for 'Required Use Cases' (e.g., 'When user requests "lock monitoring", "deadlock check", etc.') and 'Strictly Prohibited Use Cases' (e.g., 'Requests for killing sessions or force-unlocking'), providing explicit guidance on when to use this tool versus alternatives or when to avoid it entirely.

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/call518/MCP-PostgreSQL-Ops'

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