Skip to main content
Glama
foxter-io

PostgreSQL MCP Server

by foxter-io

List Tables in Schema

pg_list_tables
Read-onlyIdempotent

List all tables in a PostgreSQL schema with size and row estimates. Optionally include views and materialized views for a comprehensive schema overview.

Instructions

List all tables (and optionally views) in a PostgreSQL schema with size and row estimates.

Args:

  • schema: Schema name (default: public)

  • include_views: Also list views and materialized views (default: false)

  • response_format: Output format

Returns: JSON: { tables: TableInfo[], count: number, schema: string } Markdown: formatted table with size and row estimates

Note: estimated_rows is approximate (pg_class.reltuples) — use pg_count_rows for exact count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaNoPostgreSQL schema name (default: public)public
include_viewsNoInclude views and materialized views
response_formatNoOutput format: 'markdown' for human-readable, 'json' for machine-readablemarkdown
Behavior4/5

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

Beyond the readOnlyHint annotation, the description reveals that row estimates are approximate (from pg_class.reltuples) and that the tool supports two output formats (JSON/Markdown). 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?

The description is front-loaded with the primary purpose, followed by a structured parameter list, return format description, and a caveat. Every sentence adds value; no extraneous content.

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?

Given the tool's low complexity (3 optional parameters, no output schema), the description thoroughly covers the action, parameter defaults, return structure (both formats), and the approximate nature of estimates. It also suggests an alternative for exact counts, making it complete for an agent.

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?

All three parameters have descriptions in the input schema (100% coverage). The description repeats parameters and adds minimal extra meaning (e.g., 'human-readable' for markdown). With high schema coverage, baseline is 3 and the added value is insufficient to raise the score.

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 lists tables in a PostgreSQL schema with size and row estimates, optionally including views. This specific verb-resource combination distinguishes it from sibling tools like pg_describe_table (single table), pg_list_views (only views), or pg_count_rows (exact count).

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 a note that estimated_rows is approximate and recommends pg_count_rows for exact counts, providing guidance on when to use this tool vs an alternative. However, it does not explicitly exclude other use cases or compare to additional siblings.

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/foxter-io/mcp-postgresql'

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