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

MCPg - Production-grade PostgreSQL MCP Server

Check PITR readiness

check_pitr_readiness
Read-only

Assess PostgreSQL point-in-time recovery readiness: verify WAL archiving, wal_level, max_wal_senders, and full_page_writes, then return failing gates and ordered remediation steps.

Instructions

Assess whether the cluster is ready for point-in-time recovery (PITR) — the one-call 'could I actually recover to an arbitrary point right now, and if not what's missing?' check. Composes get_wal_archive_status (5.2) with the GUCs that gate PITR: continuous archiving must be healthy, wal_level >= replica, max_wal_senders >= 1 (so pg_basebackup can stream a base backup), and full_page_writes on (torn-page safety during replay). Read-only advisor — changes nothing, emits no secrets. Returns an object with available, ready (bool — true only when all gates pass), wal_level, archiving_healthy, gates (list of objects with name, ok, observed, remediation), remediation (ordered fixes for failing gates), and detail.

Example: check_pitr_readiness()

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

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
gatesYes
readyYes
detailNo
availableYes
wal_levelYes
remediationYes
archiving_healthyYes

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?

Annotations already declare readOnlyHint=true and openWorldHint=false; the description reinforces this with "changes nothing, emits no secrets" and adds substantive behavior the annotations cannot convey: which four gates are evaluated and why each matters. It does go on to enumerate return fields even though an output schema exists, which is mildly redundant, but the gate semantics are genuinely additive.

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?

The core claim is front-loaded in the first clause, and the intervening gate rationale is dense but purpose-driven. The trailing enumeration of return fields and the example call are somewhat redundant given the output schema, costing a point but not obscuring the main point.

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?

For a zero-required-parameter read-only advisor with full schema coverage, annotations, and an output schema, the description covers everything an agent needs: what is checked, what the gates mean, that nothing is mutated, and that remediation guidance is returned. Nothing material is missing.

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?

With a single optional `database` parameter and 100% schema description coverage, the schema already explains that it targets a configured secondary and that non-configured names are rejected. The description adds no additional meaning about this parameter, so the 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?

The description opens with a specific verb and resource ("Assess whether the cluster is ready for point-in-time recovery") and frames the scope as a composite readiness verdict rather than a raw metric dump. It explicitly names the sibling it composes (`get_wal_archive_status`), so an agent can distinguish this advisory tool from the lower-level archive-status tool.

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?

It gives a clear situational trigger — "could I actually recover to an arbitrary point right now, and if not what's missing?" — which tells the agent when this one-call check is the right choice over manually inspecting GUCs. It stops short of explicit when-not-to-use guidance or naming sibling alternatives (e.g. inspect_guc, read_pg_stat_recovery) for partial checks.

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