Skip to main content
Glama
foxter-io

PostgreSQL MCP Server

by foxter-io

Run VACUUM on a Table

pg_vacuum
Idempotent

Reclaim dead-tuple storage and optimize table performance using VACUUM, VACUUM ANALYZE, or VACUUM FULL. Choose between non-blocking reclamation, statistics update, or full rewrite with exclusive lock.

Instructions

Execute VACUUM, VACUUM ANALYZE, or VACUUM FULL on a table to reclaim dead-tuple storage.

Modes:

  • standard: Reclaims dead-tuple space for reuse within the table (non-blocking)

  • analyze: VACUUM + updates query planner statistics (recommended for most cases)

  • full: Rewrites the table to reclaim disk space to OS — requires exclusive lock, very slow on large tables

Args:

  • table: Table name (required)

  • schema: Schema name (default: public)

  • mode: 'standard', 'analyze', or 'full' (default: analyze)

  • confirm_full: Required when mode is 'full' — acknowledges table will be locked

Returns: Duration and confirmation of completion.

Warning: VACUUM FULL acquires an exclusive lock — all queries on the table will block until it completes. Use during maintenance windows only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesTable to vacuum
schemaNoSchema name (default: public)public
modeNo'standard', 'analyze', or 'full'analyze
confirm_fullNoRequired when mode=full — confirms exclusive lock accepted
Behavior5/5

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

Beyond annotations (e.g., idempotentHint: true), the description adds critical behavioral details: VACUUM FULL acquires exclusive locks and blocks queries, the return value includes duration and confirmation, and it recommends analyze for most cases. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-organized with clear sections (modes, args, returns, warning). Each sentence is purposeful, no fluff. It is concise yet thorough, perfectly balancing detail and brevity.

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?

Given the tool's complexity (locking, blocking, multiple modes), the description covers prerequisites (confirm_full), behavioral nuances (non-blocking vs. blocking), return format, and performance warnings. Annotations handle idempotency and destructive nature, so no gaps remain.

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

Parameters5/5

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

With 100% schema coverage, the description still adds value by explaining default values (schema=public, mode=analyze), requiring confirm_full for 'full' mode, and clarifying the effect of each mode on table locking and statistics. This provides actionable semantics beyond the schema's property descriptions.

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?

The description clearly states the tool executes VACUUM operations on a table to reclaim storage, and distinguishes three modes. It stands out from sibling tools (e.g., pg_bloat_report, pg_count_rows) by focusing on maintenance operations rather than inspection.

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?

The description provides excellent guidance on when to use each mode (standard, analyze, full) and warns that VACUUM FULL requires maintenance windows due to exclusive locks. However, it does not explicitly contrast with alternative sibling tools for similar tasks, such as when to use pg_bloat_report instead.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/foxter-io/mcp-postgresql'

If you have feedback or need assistance with the MCP directory API, please join our Discord server