Skip to main content
Glama

Vacuum and wraparound status

pg_vacuum_status
Read-onlyIdempotent

Report vacuum and autovacuum state—configuration, dead-row thresholds, transaction ID age, xmin blockers, running vacuums, and workers—to diagnose bloat, idle autovacuum, or wraparound risk.

Instructions

Report the state of vacuum and autovacuum: its configuration, the tables with the most dead rows measured against their autovacuum threshold (honouring per-table reloptions), transaction id and multixact age per table and per database as a percentage of the wraparound limit, what holds back the oldest xmin (sessions, prepared transactions, replication slots), vacuums running now with their progress, and the autovacuum workers.

Use it when tables bloat, autovacuum seems idle, or before a wraparound emergency. limit caps each list. For the per-table ranking by activity use pg_table_stats.

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

Input Schema

NameRequiredDescriptionDefault
limitNo
connectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so safety is covered by structured data. The description adds real value by enumerating exactly what the report covers (dead rows vs per-table autovacuum thresholds with reloptions, xid/multixact age as percentage of wraparound, xmin holders, in-progress vacuums with progress, workers). It does not discuss cost, expected runtime, or whether results are cached/snapshot-based, so it sits above baseline but below full disclosure.

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?

Two tight paragraphs: the first front-loads what is reported, the second front-loads when to use it and how limit behaves. Dense enumeration costs some readability but every clause names a distinct report section rather than padding.

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 read-only two-parameter diagnostic with no output schema, the description adequately conveys the shape of the results by listing its sections, and the usage triggers are sufficient to decide when to call it. The only real gap is the undocumented 'connection' parameter and any note on result size or pagination beyond 'limit'.

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 0%, so the description must carry parameter meaning. It clarifies that 'limit' caps each list rather than a single total, which is genuinely useful semantics. The 'connection' parameter is never mentioned, and no defaults, ranges, or validation rules appear in either place.

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 a rich set of resources: vacuum/autovacuum configuration, dead-row-vs-threshold tables, xid/multixact age as percentage of wraparound limit, xmin blockers, running vacuums and workers. It explicitly distances itself from the sibling pg_table_stats for per-table activity ranking, so an agent can separate the two without opening schemas.

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 concrete trigger conditions: 'when tables bloat, autovacuum seems idle, or before a wraparound emergency', plus routing to pg_table_stats for per-table ranking. No explicit exclusion is given (e.g., that pg_bloat is the dedicated bloat tool despite bloating being named as a trigger), which keeps it short of a full 5.

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