Skip to main content
Glama

List tables

pg_list_tables
Read-onlyIdempotent

List PostgreSQL tables, views, materialized and foreign tables with estimated rows, disk size, and comments; filter by schema or name pattern and sort by size to find large tables.

Instructions

List tables (and optionally views, materialized views, foreign tables) with estimated row count, size on disk and comment.

Filter by schema and by a name pattern (* and ? wildcards; plain text matches any name containing it). order_by="size" finds the biggest tables. Partitions are hidden behind their parent unless include_partitions is true. Row counts are the planner's estimates: instant, and close enough to choose a strategy.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "pg_list_tables"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindsNo
limitNo
offsetNo
schemaNo
patternNo
order_byNoname
connectionNo
include_partitionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so credit goes to what the description adds: row counts are planner estimates rather than exact (a real accuracy caveat) and partitions are collapsed into their parent unless include_partitions is set. Both are non-obvious behaviors that change how an agent interprets results.

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?

Front-loaded with the return contents, then a compact paragraph of filtering, ordering, partition, and accuracy notes. Nearly every clause carries distinct information; no restatement of the name or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an eight-parameter tool with no output schema and no parameter descriptions, the definition is helpful on kind, pattern, ordering, and partition behavior but silent on pagination (there is a default limit of 100), connection targeting, and the result shape. Adequate to call correctly in the common case, thin for a tool with this many knobs.

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 coverage is 0%, so the description carries the burden for eight parameters, and it only covers roughly half: pattern wildcards plus plain-text substring matching is genuinely useful added semantics, as are schema, order_by="size", and include_partitions. Limit, offset, and connection are never mentioned, leaving pagination and target-selection behavior entirely undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb and resource ('List tables') and immediately enumerates what is returned (estimated row count, size on disk, comment) plus the optional object kinds. It is clearly a catalog-listing tool, though it never explicitly contrasts itself with the near-named sibling pg_list_objects, leaving that distinction to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is implied rather than spelled out: 'order_by="size" finds the biggest tables' and 'close enough to choose a strategy' hint at planning/investigation use and at when exact counts (e.g. pg_count_rows) would be preferable, but no alternative tool is named and there are no explicit when-not conditions. The partition-hiding note is behavioral rather than usage guidance.

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