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

MCPg - Production-grade PostgreSQL MCP Server

Get PG 19 DDL status

get_pg19_ddl_status
Read-only

Checks whether PostgreSQL 19's DDL-dump functions are usable; returns availability flags and pg_dumpall fallback guidance for older servers.

Instructions

Report whether PG 19's pg_get_roledef() / pg_get_databasedef() / pg_get_tablespacedef() DDL-dump functions are usable on this server. Never raises — driver-level errors surface as available=false. On PG ≤ 18 reports available=false and points the agent at pg_dumpall --roles-only / --globals-only / --tablespaces-only as the fallback. Returns an object with available (bool), server_version_num (int), server_version, has_pg_get_roledef (bool), has_pg_get_databasedef (bool), has_pg_get_tablespacedef (bool), and detail (guidance string).

Example: get_pg19_ddl_status()

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

Input Schema

NameRequiredDescriptionDefault
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
availableYes
server_versionYes
has_pg_get_roledefYes
server_version_numYes
has_pg_get_databasedefYes
has_pg_get_tablespacedefYes

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 readOnlyHint/openWorldHint, the description adds a genuinely useful behavioral guarantee: it never raises and driver-level errors are folded into available=false. It also enumerates the returned fields, including a detail guidance string, which goes past the annotations.

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 core question in the first sentence, then error behavior, fallback, and return shape in a compact sequence. Slightly dense with the field enumeration, but each sentence does work.

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?

Covers capability detection, version gating, failure semantics, and fallback path; with an output schema present, the description need not explain return values further. An agent has everything needed to call it and act on the result.

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?

The single database parameter is documented at 100% schema coverage, including the 'configured id only, omit for primary' constraint, so the schema carries the semantics. The description itself says nothing about the parameter, so baseline 3 applies.

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 (report/check) and a specific resource: whether PG 19's pg_get_roledef()/pg_get_databasedef()/pg_get_tablespacedef() DDL-dump functions are usable. This clearly separates it from the sibling DDL-emitting tools get_role_ddl, get_database_ddl and get_tablespace_ddl.

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?

Tells the agent what happens on PG ≤ 18 (available=false) and names concrete fallbacks (pg_dumpall --roles-only/--globals-only/--tablespaces-only), which is real when-to-use guidance. It stops short of explicitly saying 'call this before get_role_ddl/get_database_ddl', which would have made the routing unambiguous.

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