Skip to main content
Glama

Health check

pg_health_check
Read-onlyIdempotent

Check whether a PostgreSQL database is healthy by running a quick DBA check-up that returns severity-ranked findings on connections, locks, wraparound, indexes, replication, and configuration.

Instructions

Run a quick DBA check-up and return findings ranked by severity: connection use, long transactions, sessions idle in transaction, blocked sessions, transaction id wraparound, dead rows, invalid and duplicate indexes, sequences near their end, cache hit ratio, forced checkpoints, inactive replication slots, tables never analyzed or without a primary key, deadlocks, temporary files, rollback ratio, settings waiting for a restart, autovacuum, fsync/full_page_writes and orphaned prepared transactions.

Start here when asked "is this database healthy?". Every finding has a severity (critical, warning, info, ok), the measured value, the threshold used and the tool that goes deeper. A check that cannot run on this server version or with this role is reported as not_available and the others still run. It only reads statistics and catalogs.

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

Input Schema

NameRequiredDescriptionDefault
connectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, but the description adds real behavioral context beyond them: findings are ranked by severity with a critical/warning/info/ok taxonomy, each carries the measured value and threshold, and unsupported checks degrade to `not_available` rather than failing the whole call. That partial-failure semantics is exactly what an agent needs and is not derivable from 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 action and return contract before the long checklist, which is the right ordering. The 20-item enumeration of checks is dense but informative for scoping expectations; it is the one place a reader may skim, though trimming it would lose genuine signal.

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?

With no output schema, the description carries the return-value burden and does so adequately: it describes the per-finding fields (severity, measured value, threshold, deeper tool) and the `not_available` marker. Combined with the read-only annotation and the triage framing, an agent has enough to call it correctly and interpret results.

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?

The single `connection` parameter has 0% schema description coverage and is never mentioned in the description, so nothing explains what a connection identifier looks like, whether omitting it targets a default server, or how to select among multiple databases. With only one optional param and no compensating text, the agent is left to guess at the one input it must supply.

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 ("Run a quick DBA check-up") and then enumerates the exact checks performed, from connection use to orphaned prepared transactions. It also positions itself against siblings by promising each finding names "the tool that goes deeper," so an agent can distinguish this triage tool from pg_activity, pg_locks, pg_bloat and the rest.

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 a crisp entry-point rule: "Start here when asked 'is this database healthy?'", which tells the agent to call this before the narrower siblings. It does not state explicit exclusions (e.g. when to skip it and go straight to a specific tool), so it falls short of the full when/when-not/alternatives bar.

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