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

MCPg - Production-grade PostgreSQL MCP Server

Read autovacuum priority

read_autovacuum_priority
Read-only

Ranks tables by urgency for autovacuum using dead-tuple counts against per-table thresholds, returning priority labels and inputs to explain why each table needs attention.

Instructions

Return the tables most urgently needing autovacuum, ranked by how close their dead-tuple count is to the per-table autovacuum threshold (autovacuum_vacuum_threshold + autovacuum_vacuum_scale_factor * reltuples, honouring per-table reloptions overrides). Each row carries priority ('overdue' if past the threshold, 'watchlist' if within 50%, 'borderline' otherwise) plus the inputs (n_dead_tup, vacuum_threshold, last_autovacuum, autovacuum_enabled) so the agent can explain why a table landed on the shortlist. Top-level overdue_count lets an agent branch without walking the list. Read-only catalog query.

Example: read_autovacuum_priority(limit=25)

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

Input Schema

NameRequiredDescriptionDefault
limitNo
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
rowsYes
detailYes
availableYes
overdue_countYes
watchlist_countYes

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 carry readOnlyHint=true and openWorldHint=false, and the description adds real behavioral substance beyond that: the exact threshold formula, that per-table reloptions overrides are honoured, and the concrete cutoffs defining 'overdue'/'watchlist'/'borderline'. The sentence 'Read-only catalog query' is redundant with the annotations but does not contradict them.

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 ranking rule, then the row shape, then the top-level field, then a concrete example — a sensible order with little wasted text. The trailing 'Read-only catalog query' repeats what readOnlyHint already declares, a minor redundancy in an otherwise dense and useful block.

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?

Despite the output schema existing, the description still names the key returned fields and the branchable overdue_count, and it fully documents the ranking logic and bucket definitions. For a two-parameter read-only ranking tool, nothing an agent needs to call or interpret it 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?

Schema coverage is only 50%: 'database' is well documented in the schema, but 'limit' has no description at all. The description implies top-N selection and shows limit=25 in the example, yet never states what limit caps or how ranking interacts with truncation, so it only partially compensates for the gap.

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 ('Return the tables most urgently needing autovacuum') plus the ranking criterion, which is far more precise than the title alone. An agent can distinguish this shortlist/prioritization tool from siblings like analyze_table_bloat or check_database_health without opening a schema.

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 clear operating context: the priority buckets tell the agent what each row means, the included inputs exist 'so the agent can explain why', and 'overdue_count' lets it branch without walking the list. It stops short of naming alternative tools or stating when NOT to call it, so it misses the top band.

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