Skip to main content
Glama
Teja-sudo

postgres-mcp-server

by Teja-sudo

lock_check

Analyze PostgreSQL DDL statements to determine lock levels, full table rewrites, and estimated duration. Get warnings for high-impact locks and actionable recommendations before running on production.

Instructions

Static analysis of a SQL statement to determine the PostgreSQL lock level it will require, whether it forces a full table rewrite, and an estimated duration based on target table size. Returns warnings for ACCESS EXCLUSIVE locks on busy production tables and concrete recommendations (e.g., use CREATE INDEX CONCURRENTLY, NOT VALID + VALIDATE CONSTRAINT, etc). Use BEFORE running DDL on production. Knows lock semantics for ALTER TABLE variants, CREATE/DROP INDEX (concurrent vs not), VACUUM, CLUSTER, REFRESH MATERIALIZED VIEW, and more.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL DDL statement to analyze.
estimate_durationNoLook up target table size to estimate duration.
serverNo
databaseNo
schemaNo
Behavior3/5

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

No annotations exist, so description carries full burden. It describes outputs (warnings, recommendations) and scope of knowledge, but does not explicitly state it is read-only or handle edge cases. Adequate but not exhaustive.

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 a single paragraph, front-loads the key action, and contains no fluff. Could be slightly more structured but is efficient.

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?

For a complex lock analysis tool with no output schema and low parameter coverage, the description covers the main purpose and outputs but lacks specifics on return format, permissions, and limitations. Adequate for basic understanding.

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 low (40%). The description does not explain the server, database, or schema parameters, failing to compensate. Only sql and estimate_duration are described in schema, and description adds no further detail.

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 clearly states the tool performs static analysis of SQL statements to determine PostgreSQL lock level, table rewrite, duration, and provides warnings/recommendations. It differentiates from sibling tools which are about database health, query indexes, etc.

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

Usage Guidelines4/5

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

Explicitly advises 'Use BEFORE running DDL on production' and lists known SQL variants. While no explicit exclusions or alternatives are given, the usage context is clear.

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/Teja-sudo/postgres-mcp-server'

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