Skip to main content
Glama
Teja-sudo

postgres-mcp-server

by Teja-sudo

describe_table

Retrieve complete table metadata including columns, constraints, indexes, size, row count, and sample rows in a single request, replacing multiple database queries.

Instructions

Single rich call describing a table: columns (type/nullable/default + null %/distinct ratio from pg_stats), primary key, foreign keys going OUT (this table → others) AND coming IN (others → this table), all indexes (with definitions), table size, row-count estimate, and sample rows. Replaces ~5 separate calls (get_object_details + LIMIT 5 + COUNT(*) + pg_stats).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesTable name (unqualified — use schema for the schema).
schemaNopublic
sample_sizeNoNumber of sample rows to fetch (0 to skip).
profile_columnsNoColumns to profile (default: all up to 20).
serverNo
databaseNo
override_schemaNoOne-time schema override for the connection (separate from `schema` which is the table's schema).
Behavior4/5

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

No annotations provided, so the description carries full burden. It describes the rich read output and parameter behaviors (sample_size can skip, profile_columns default up to 20). It does not explicitly state it is read-only, but that is strongly implied by the listing nature. Slight room to mention non-destructiveness.

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, front-loaded with the core proposition ('replaces ~5 separate calls'). Every piece of information earns its place; no fluff.

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?

Given 7 parameters and no output schema, the description covers the tool's purpose, output, and parameter behaviors well. It does not detail the return format, but the listing of returned fields provides adequate context for an agent. Minor gap: no mention of error handling or prerequisites.

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?

Schema coverage is 57%, and the description adds meaning to key parameters: table is unqualified, schema is separate from override_schema, sample_size and profile_columns have defaults explained. Server and database lack schema descriptions, but the description does not compensate; still, overall adds value beyond schema.

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?

Description clearly states it's a single call describing a table, enumerating all returned elements (columns, PKs, FKs, indexes, size, row count, sample rows). It also explicitly contrasts with alternatives, making the tool's unique value unmistakable.

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 states that this tool replaces ~5 separate calls (get_object_details + LIMIT 5 + COUNT(*) + pg_stats), providing clear when-to-use guidance. No ambiguity about its purpose versus sibling tools.

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