Skip to main content
Glama

Replication status

pg_replication
Read-onlyIdempotent

Check PostgreSQL replication health: see primary/standby roles, lag, retained WAL slots, publications, subscriptions, conflicts, and settings to diagnose stalled replicas or disk-filling slots.

Instructions

Show the replication state of the server in one answer: whether it is a primary or a standby, connected standbys with lag, replication slots and the WAL they retain, the WAL receiver and replay delay on a standby, publications with their tables, subscriptions with their statistics, recovery conflicts and the settings that govern replication.

Use it to check that replicas are healthy, to find an abandoned slot that makes the disk fill with WAL, or to see what logical replication publishes. Connection strings and passwords are never shown. A server without any replication says so plainly.

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_replication"
  }
}

Input Schema

NameRequiredDescriptionDefault
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?

With readOnlyHint, idempotentHint, and destructiveHint already declared, the description adds useful behavioral context: connection strings and passwords are never shown, and a non-replicating server is reported plainly. It does not contradict the annotations, though it says little about permissions or performance implications.

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 description is front-loaded with the core replication areas and then adds practical use cases and privacy/empty-state behavior. It is longer than average but structured and largely free of filler.

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 complex monitoring tool without an output schema, the description covers the main reported areas, use cases, privacy, and empty-state behavior well. Its notable omission is any explanation of the optional connection parameter, which matters given the 0% schema coverage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There is one optional connection parameter, and the schema has 0% description coverage, so the description must compensate for that gap. It never mentions the connection parameter or explains which server the connection selects, leaving the only input semantically 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?

The description uses a specific verb and resource: it shows replication state including primary/standby role, standby lag, slots, WAL receiver, publications, subscriptions, and conflicts. It is clear what the tool does, but it does not explicitly distinguish itself from adjacent monitoring siblings such as pg_health_check or pg_activity.

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 concrete when-to-use scenarios: checking replica health, finding an abandoned slot that fills disk with WAL, and inspecting logical replication publications. It does not state when not to use it or name alternative tools for overlapping checks.

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