Skip to main content
Glama
MCP PostgreSQL Operations

MCP PostgreSQL Operations

by call518

get_vacuum_analyze_stats

Retrieve per-table VACUUM and ANALYZE execution history, last run times, auto-maintenance counts, and tuple activity statistics to verify database maintenance status and diagnose performance issues.

Instructions

[Tool Purpose]: Analyze VACUUM and ANALYZE execution history and statistics per table

[Exact Functionality]:

  • Retrieve last VACUUM/ANALYZE execution time for each table

  • Provide Auto VACUUM/ANALYZE execution count statistics

  • Analyze table activity with tuple insert/update/delete statistics

[Required Use Cases]:

  • When user requests "VACUUM status", "ANALYZE history", "table statistics", etc.

  • When database maintenance status overview is needed

  • When performance issues or statistics update status verification is required

[Strictly Prohibited Use Cases]:

  • Requests for VACUUM or ANALYZE execution

  • Requests for Auto VACUUM configuration changes

  • Requests for forced statistics update

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

Input Schema

NameRequiredDescriptionDefault
database_nameNoDatabase name to analyze (uses default database if omitted)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.4.3
    • addedInput schema / properties / database_name / description
      Added value: +"Database name to analyze (uses default database if omitted)"
  2. Changed6 schema fields changedv3.4.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / database_name / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / database_name / title
      Removed value: -"Database Name"
    • removedInput schema / properties / database_name / type
      Removed value: -"string"
    • removedOutput schema / properties / result / title
      Removed value: -"Result"
    • removedOutput schema / title
      Removed value: -"_WrappedResult"
  3. Addedv1.0.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it makes clear this is a read-only inspection of history, explicitly excluding execution and configuration changes. It also discloses what data is returned per table. It does not state permissions, cost, or result volume for large catalogs, keeping it below 5.

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?

Bracketed section headings make the purpose front-loaded and highly scannable, and every section carries real content. The header scaffolding is slightly heavy for a one-parameter read tool, but no sentence is 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?

Purpose, data returned, triggers, and exclusions are all covered, and an output schema handles return-value detail. What remains unsaid is how the history is bounded (time window, retention), which matters for interpreting 'last execution time'.

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?

Single optional parameter with 100% schema description coverage; the schema already explains database_name and its default. The description adds nothing about scoping behavior beyond the schema, so the baseline 3 applies.

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 states a specific verb and resource — analyze VACUUM/ANALYZE execution history and per-table statistics — and enumerates the concrete outputs (last execution time, autovacuum counts, tuple insert/update/delete stats). It does not name or differentiate itself from near-siblings like get_autovacuum_status or get_vacuum_effectiveness_analysis, so an agent must infer the boundary.

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?

Unusually explicit: it lists required use cases (user asks for 'VACUUM status', maintenance overview, performance troubleshooting) and strictly prohibited use cases (executing VACUUM/ANALYZE, changing autovacuum config, forcing stats update). It stops short of naming the alternative tools to use for those prohibited actions, which would be the 5-level behavior.

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