Skip to main content
Glama
MCPg - Production-grade PostgreSQL MCP Server

MCPg - Production-grade PostgreSQL MCP Server

List distribution policies

list_distribution_policies
Read-only

Lists each WarehousePG table’s distribution policy (HASH, RANDOM, or REPLICATED) and distribution-key columns; omit schema to inspect all non-system schemas.

Instructions

List the data-distribution policy for each table in a WarehousePG schema (HASH(col,...), RANDOM, or REPLICATED). Joins gp_distribution_policy to pg_attribute for the distribution-key column names in catalog order. schema=None returns every non-system schema. Read-only. On vanilla PG returns available=false with a diagnostic.

Example: list_distribution_policies(schema='public')

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": "list_distribution_policies"
  }
}

Input Schema

NameRequiredDescriptionDefault
schemaNo
databaseNoOptional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected.

Output Schema

NameRequiredDescriptionDefault
detailYes
policiesYes
availableYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.4
    • changedInput schema / properties / database / description
      Previous value: -"Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids."New value: +"Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected."
  2. First observedv0.6.8

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the readOnlyHint/openWorldHint annotations it discloses meaningful behavior: the underlying catalog join, that column names come back in catalog order, that all non-system schemas are returned by default, and the graceful `available=false` fallback on vanilla PG. Missing only return-shape detail, which the output schema covers.

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?

Three tight sentences plus a one-line example, front-loaded with the core action and policy values. The catalog-join sentence is dense but earns its place by justifying the column ordering of results.

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?

For a two-parameter read-only catalog tool with an output schema and full annotations, this is nearly complete: scope, defaults, and the unsupported-platform fallback are all stated. The only gap is not addressing the `database` parameter or the potential confusion with the RLS-oriented `list_policies` sibling.

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 50%: `database` is documented in the schema while `schema` is not. The description partially compensates by explaining `schema=None` returns every non-system schema, but it never mentions the `database` targeting argument. Baseline 3 given the schema already carries the other half.

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 ("List the data-distribution policy for each table in a WarehousePG schema") and enumerates the exact policy forms returned (HASH(col,...), RANDOM, REPLICATED). This clearly separates it from sibling catalog listings such as list_tables or list_policies.

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?

Gives clear operating context: it is WarehousePG-specific, `schema=None` covers every non-system schema, and on vanilla PostgreSQL it returns `available=false` with a diagnostic rather than erroring. It does not explicitly contrast itself with the similarly named `list_policies` (RLS) or `describe_table`, so the agent must infer the boundary.

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