Skip to main content
Glama
YawLabs

@yawlabs/postgres-mcp

by YawLabs

pg_advisor

Read-onlyIdempotent

Run a DBA lint check to identify sequence exhaustion risks, tables missing primary keys, and public tables with row-level security disabled. Get actionable findings sorted by category.

Instructions

Rolled-up DBA lint pass. One call returns three categories of findings:

  • sequence_exhaustion: SERIAL / BIGSERIAL / IDENTITY sequences whose last_value is above seqExhaustionThreshold of max_value. The classic incident class.

  • tables_without_primary_key: user tables (plain and partitioned) with no PK defined. Bloat candidates and a sign of design drift; some replication setups also need PKs. Foreign tables are excluded -- PostgreSQL forbids declaring PKs on foreign tables.

  • public_tables_without_rls: tables in public (or any schema in rlsSchemas) with row-level security disabled. Useful as a security baseline check. Use this as the 'what should I be looking at?' starting point, then drill into pg_unused_indexes, pg_table_bloat, pg_seq_scan_tables for the perf side.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax rows per category (default 50).
rlsSchemasNoSchemas where RLS-missing should be flagged. Defaults to ['public'].
seqExhaustionThresholdNoMinimum used-fraction (last_value / max_value) to flag a sequence (default 0.5 = 50%).
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint true, destructiveHint false. Description adds detailed behavioral context: criteria for each finding, exclusions (foreign tables), and thresholds. No contradictions.

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?

Well-structured with a clear opening sentence, bullet-like list of categories, and a final usage recommendation. No redundant text, every sentence provides essential information.

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?

For a tool with no output schema, the description thoroughly explains what the three output categories contain and why they matter. Combined with annotations and sibling context, the tool is fully understandable without additional information.

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?

All three parameters have schema descriptions (100% coverage). Description adds value by explaining how 'seqExhaustionThreshold' is used in sequence check and that 'rlsSchemas' controls which schemas are checked for missing RLS. 'limit' is not elaborated but schema covers it.

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?

Clearly states it's a 'Rolled-up DBA lint pass' returning three specific categories (sequence exhaustion, tables without PK, tables without RLS), each explained. Distinct from sibling tools like pg_unused_indexes, pg_table_bloat.

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?

Explicitly says 'Use this as the what should I be looking at? starting point, then drill into pg_unused_indexes, pg_table_bloat, pg_seq_scan_tables for the perf side.' Provides clear when-to-use and alternatives.

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/YawLabs/postgres-mcp'

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