Skip to main content
Glama
YawLabs

@yawlabs/postgres-mcp

by YawLabs

pg_describe_table

Read-onlyIdempotent

Describe a PostgreSQL relation's structure: columns, keys, indexes, partitions, and constraints for tables, views, and materialized views.

Instructions

Describe a relation: kind (table / view / materialized_view / partitioned_table / foreign_table), columns (name, type, nullable, default), primary key, foreign keys (outgoing), referenced_by (other tables whose FKs point at this one), constraints (CHECK / UNIQUE non-PK / EXCLUDE), indexes, and partition info (partition_of parent, partitions children). Works on views and materialized views too -- PK/FK/constraint/index lists will simply be empty for a plain view. Use kind to disambiguate before assuming you can write to the relation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesTable name.
schemaNoSchema name (defaults to 'public').public
Behavior5/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true. The description adds behavioral details beyond annotations: specifics on what is returned (columns, PK, FKs, etc.) and notes that for views certain lists are empty. This fully aligns with annotations and provides excellent transparency.

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 sentence with a list of returned fields. It is reasonably concise and front-loads the purpose. Minor redundancy could be trimmed (e.g., 'kind (table / view / ...)' already implies the enumeration), but overall efficient.

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?

The description covers most necessary context: the types of relations it works on, what fields are returned, and edge cases for views. Without an output schema, it provides enough detail for an agent to understand the return value. However, it does not describe the exact JSON structure or mention any limits.

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?

Both parameters are fully described in the input schema (100% coverage). The description adds no new semantic meaning beyond what the schema provides, such as mentioning the default schema. Baseline score of 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 it describes a relation and enumerates the returned fields (kind, columns, PK, FKs, etc.). It distinguishes the tool from siblings like pg_list_tables by specifying the detailed output. The verb 'describe' accurately captures the function.

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?

The description includes an explicit usage note: 'Use `kind` to disambiguate before assuming you can write to the relation.' It implies when to use the tool (when you need schema details) and hints at limitations for views. However, it does not directly contrast with 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/YawLabs/postgres-mcp'

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