Skip to main content
Glama

List partitions

pg_list_partitions
Read-onlyIdempotent

Shows a partitioned table's partitions as a tree with bounds, keys, row/size estimates, and strategy; lists inheritance children with CHECK constraints on PostgreSQL 9.6.

Instructions

Show the partitions of a partitioned table as a tree: each partition with its bounds (FOR VALUES ..., DEFAULT), its own partition key when it is partitioned again, estimated rows and size on disk, plus the partitioning strategy (range, list, hash) and key.

On PostgreSQL 9.6, which has no declarative partitioning, it shows the table inheritance children and their CHECK constraints instead. A table without partitions or children answers with an empty list.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "table": "<table>"
    },
    "name": "pg_list_partitions"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableYes
connectionNo

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 declare readOnlyHint, idempotentHint and non-destructive, so the safety profile is covered. The description goes beyond them usefully, disclosing the tree-shaped return layout, the version-dependent 9.6 fallback to inheritance children and CHECK constraints, and the empty-list result for tables with no partitions. It does not mention permissions or performance cost of the catalog scans, which keeps it from a 5.

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?

Front-loaded with the primary behavior, then the version-specific caveat, then the empty-result case in a short three-sentence block. Every sentence adds information; the parenthetical list of partition strategies is slightly dense but earns its place.

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?

With no output schema, the description correctly carries the burden of explaining return values, and it does so in detail. The main gap is the unexplained 'connection' parameter, which matters for a tool that can target different databases.

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 0% for the two parameters, so the description must compensate. It implies the 'table' parameter must be a partitioned (or inheritance-parent) table, which is genuinely useful, but the 'connection' parameter is never mentioned, leaving half the parameters undocumented in both schema and description.

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?

States a specific verb and resource ('Show the partitions of a partitioned table as a tree') and enumerates exactly what is returned: bounds, sub-partition key, estimated rows, size, strategy and key. That is far more than a restatement of the name. It stops short of explicitly distinguishing itself from siblings like pg_list_tables or pg_describe_table, so a 4 rather than a 5.

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 is only implied: an agent can infer it should call this when it needs partition structure. Edge-case behavior is covered well (9.6 inheritance fallback, empty list for unpartitioned tables), but there is no explicit 'use this instead of X when...' routing or prerequisite statement.

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