Skip to main content
Glama
call518

MCP PostgreSQL Operations

get_table_bloat_analysis

Analyze PostgreSQL table bloat by calculating dead tuple ratios, estimating bloat size, and identifying tables requiring VACUUM maintenance to optimize storage and performance.

Instructions

[Tool Purpose]: Analyze table bloat based on dead tuple statistics and size information

[Exact Functionality]:

  • Calculate bloat ratio based on dead tuples vs total tuples

  • Estimate bloat size in bytes and human-readable format

  • Show last VACUUM/AUTOVACUUM timestamps for maintenance tracking

  • Identify tables requiring VACUUM maintenance

  • Filter tables by name pattern using SQL LIKE or ILIKE matching

  • Sort results by bloat severity (dead tuple ratio and count)

[Required Use Cases]:

  • When user requests "table bloat", "bloat analysis", "dead tuples", etc.

  • When identifying tables that need VACUUM maintenance

  • When investigating database storage efficiency and space usage

  • When troubleshooting performance issues related to table bloat

  • When analyzing specific table groups (e.g., tables with "user", "log", "temp" in names)

[Strictly Prohibited Use Cases]:

  • Requests for automatic VACUUM execution

  • Requests for bloat removal or cleanup operations

  • Requests for table restructuring or data modification

Args: database_name: Target database name (uses default database from POSTGRES_DB env var if omitted) schema_name: Schema to analyze (analyzes all user schemas if omitted) table_pattern: Table name pattern to filter (SQL LIKE pattern, e.g., 'user%', '%log%', 'temp_*') min_dead_tuples: Minimum dead tuples to include in results (default: 1, shows all tables with any bloat) limit: Maximum number of results to return (1-100, default: 20)

Returns: Table bloat analysis with bloat ratios, sizes, and maintenance recommendations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_nameNo
schema_nameNo
table_patternNo
min_dead_tuplesNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It effectively describes what the tool does (analysis, not modification), output characteristics (bloat ratios, sizes, maintenance recommendations), and operational constraints (filtering via SQL LIKE/ILIKE, sorting by severity). It doesn't mention rate limits, authentication needs, or performance characteristics, but provides substantial behavioral context beyond basic functionality.

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?

The description is well-structured with clear sections ([Tool Purpose], [Exact Functionality], etc.) that make it easy to parse. While comprehensive, some sections could be more concise - the [Exact Functionality] uses 6 bullet points where 3-4 might suffice. However, every sentence adds value and the structure helps with quick scanning.

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 analytical complexity, 5 parameters with 0% schema coverage, no annotations, but with an output schema, the description is remarkably complete. It covers purpose, functionality, usage guidelines, parameter semantics, and return value description. The output schema existence means the description doesn't need to detail return structure, allowing it to focus on operational context, which it does thoroughly.

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 0% schema description coverage and 5 parameters, the description provides excellent parameter semantics. The Args section clearly explains each parameter's purpose, default values, constraints (e.g., '1-100' for limit), and usage examples (e.g., SQL LIKE pattern examples). This fully compensates for the lack of schema descriptions and adds meaningful context beyond what the bare schema provides.

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 explicitly states the tool's purpose as 'Analyze table bloat based on dead tuple statistics and size information' in the [Tool Purpose] section, which is a specific verb+resource combination. It clearly distinguishes this from sibling tools like get_database_bloat_overview (database-level vs table-level analysis) and get_vacuum_effectiveness_analysis (different analytical focus).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides comprehensive usage guidance with dedicated sections: [Required Use Cases] lists five specific scenarios when to use this tool, and [Strictly Prohibited Use Cases] explicitly states three scenarios when NOT to use it (e.g., 'Requests for automatic VACUUM execution'). This gives clear alternatives (use other tools for those prohibited actions) and context for appropriate application.

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/call518/MCP-PostgreSQL-Ops'

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