Skip to main content
Glama
YawLabs

@yawlabs/postgres-mcp

by YawLabs

pg_seq_scan_tables

Read-onlyIdempotent

Identify tables with high sequential scan ratios to find missing index candidates. Focus on tables where queries read entire rows instead of using indexes, reducing query performance.

Instructions

Tables with high sequential-scan counts relative to index scans - the first place to look for missing-index candidates. Returns seq_scans, idx_scans, live tuples, and the ratio. A high ratio on a large table usually means a query is reading the whole table where an index would suffice. Pair with pg_top_queries to find which query is doing it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax rows to return (default 20).
schemaNoLimit to one schema. If omitted, all user schemas are included.
minSizeNoMinimum live tuple count to include (default 1000, filters out tiny/empty tables).
Behavior5/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds meaningful context: it returns seq_scans, idx_scans, live tuples, and the ratio, and explains how a high ratio indicates a full table scan. No contradictions with annotations.

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?

Three sentences: first defines purpose, second lists outputs and interpretation, third suggests pairing. No redundant words, front-loaded key info.

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?

Despite no output schema, the description explains what the tool returns and the meaning of the ratio. Together with schema docs for parameters, the tool is fully described for its read-only analytic purpose.

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

Parameters3/5

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

Schema descriptions cover 100% of parameters (limit, schema, minSize) with clear defaults and constraints. The description does not add extra parameter information, so baseline 3 is appropriate.

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 identifies tables with high sequential-scan counts relative to index scans, specifically as a starting point for missing-index candidates. It distinguishes from siblings by naming a complementary tool (pg_top_queries), showing differentiation.

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 explicitly positions this as 'the first place to look for missing-index candidates' and advises pairing with pg_top_queries to find the problematic query. This provides clear when-to-use guidance and an alternative action.

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