Skip to main content
Glama
call518

MCP PostgreSQL Operations

by call518

get_database_bloat_overview

Summarize PostgreSQL bloat across all schemas, identify tables with the highest bloat ratios and aggregate dead tuples, and review storage efficiency to plan database maintenance.

Instructions

[Tool Purpose]: Provide database-wide bloat overview and summary statistics

[Exact Functionality]:

  • Summarize bloat statistics across all schemas

  • Identify schemas and tables with highest bloat ratios

  • Calculate total estimated bloat size per schema

  • Show aggregate dead tuple counts and maintenance status

[Required Use Cases]:

  • When user requests "database bloat overview", "bloat summary", etc.

  • When getting high-level view of database storage efficiency

  • When planning database maintenance activities

  • When investigating overall database performance issues

[Strictly Prohibited Use Cases]:

  • Requests for automatic maintenance operations

  • Requests for bloat cleanup or removal

  • Requests for schema or database restructuring

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of schemas to show (1-50, default: 10)
database_nameNoTarget database name (uses default database from POSTGRES_DB env var if omitted)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.4.3
    • addedInput schema / properties / database_name / description
      Added value: +"Target database name (uses default database from POSTGRES_DB env var if omitted)"
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of schemas to show (1-50, default: 10)"
  2. Changed7 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"
    • removedInput schema / properties / limit / title
      Removed value: -"Limit"
    • removedOutput schema / properties / result / title
      Removed value: -"Result"
    • removedOutput schema / title
      Removed value: -"_WrappedResult"
  3. Addedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden, and it does clarify that the tool summarizes and reports rather than performing maintenance, cleanup, or restructuring. It does not explicitly state read-only status, permissions, or rate limits, but its prohibited-use section meaningfully reduces ambiguity about side effects.

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 and front-loads the purpose, functionality, and usage constraints. It is somewhat verbose with labeled sections and repetitive prohibited-use bullets, but the structure remains useful rather than bloated.

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 low complexity, only two optional parameters, full schema description coverage, and an output schema, the description is complete enough for correct invocation. It covers purpose, scope, use cases, and exclusions without needing to explain return values in detail.

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 100%, so the schema already documents both parameters, including limit and database_name. The description adds no parameter-specific guidance beyond the schema, so the baseline score of 3 is appropriate.

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 states a specific verb and resource: provide a database-wide bloat overview and summary statistics. It clarifies scope with 'across all schemas', 'per schema', and aggregate dead tuple counts, which distinguishes it from table-level siblings such as get_table_bloat_analysis.

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?

It gives explicit required use cases and strictly prohibited use cases, including when to use it for high-level storage efficiency or maintenance planning. It does not explicitly name alternative sibling tools for more granular analysis, so it stops short of a full when/when-not/alternatives routing statement.

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