Skip to main content
Glama
amar141989-dev

readonly-postgres-mcp

pg_describe

Read-onlyIdempotent

Inspect PostgreSQL schema: list tables, views, and materialized views with row counts, or describe columns, types, keys, and comments for a specific table. Avoid manual information_schema queries.

Instructions

Inspect the database schema.

Call with no arguments to list the tables, views and materialized views in the configured search path, with their estimated row counts and comments. Call with "table" to list that relation's columns, types, nullability, defaults, primary keys and comments.

Prefer this over querying information_schema by hand: it is faster and reports partitioned tables and comments correctly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableNoTable or view name. Omit to list all relations in the search path.
schemaNoRestrict to a single schema. Defaults to the configured search path.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4/5.0
Behavior3/5

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

Annotations declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, covering the safety and idempotency profile. The description adds that it is faster than querying information_schema and correctly reports partitioned tables and comments, which is useful behavioral context. But it does not describe output format, pagination, or performance limits beyond the speed claim.

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?

Four sentences, each earning its place. The purpose is front-loaded, followed by mode-specific instructions and a comparative advantage. No filler or repetition.

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?

Complete enough for an agent to call the tool correctly: it knows the two modes, what each returns, and why to prefer it. The absence of an output schema is offset by the description's enumeration of return fields (tables, views, row counts, comments; columns, types, nullability, defaults, primary keys). Missing only explicit guidance on when to use pg_query_sql instead.

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 description coverage is 100%, so both parameters are fully documented in the schema. The description hints at the 'table' parameter's dual role (listing mode when omitted, detail mode when provided) but adds little beyond the schema's own descriptions. 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?

States a specific verb and resource: 'Inspect the database schema.' The description then distinguishes the two modes of operation (no-args relation listing vs. table-specific column inspection). An agent knows exactly what this tool does and how it differs from pg_query_sql.

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?

Provides explicit usage modes: call with no arguments for relation listing, call with 'table' for column details. It also advises preferring this over querying information_schema by hand. However, it does not explicitly state when to use pg_query_sql instead, which is the sibling tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools