Skip to main content
Glama
gokiwitech

pgwarden-mcp

by gokiwitech

analyze_db_health

Read-only

Runs PostgreSQL health checks to detect invalid indexes, connection saturation, transaction wraparound, sequence exhaustion, replication lag, and low buffer hit rates.

Instructions

Analyzes database health. Here are the available health checks:

  • index - checks for invalid, duplicate, and bloated indexes

  • connection - checks the number of connection and their utilization

  • vacuum - checks vacuum health for transaction id wraparound

  • sequence - checks sequences at risk of exceeding their maximum value

  • replication - checks replication health including lag and slots

  • buffer - checks for buffer cache hit rates for indexes and tables

  • constraint - checks for invalid constraints

  • all - runs all checks You can optionally specify a single health check or a comma-separated list of health checks. The default is 'all' checks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
databaseNoOptional. Alias of the configured database to query. Omit it when the server has only one database configured. When several are configured this parameter is required - call list_databases first to learn the valid aliases.
health_typeNoOptional. Valid values are: all, buffer, connection, constraint, index, replication, sequence, vacuum.all

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only mark readOnlyHint as true, so the description adds meaningful behavioral context by detailing exactly what each check covers and clarifying that 'all' runs everything. It does not mention performance costs or guardrails, but the read-only annotation plus the enumerated checks cover the most important behavioral expectations.

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 front-loaded with the core purpose and then uses a clear bulleted list for the health check options. It is slightly longer than strictly necessary, but every sentence contributes meaningful detail and the structure aids scannability.

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?

For a tool with two optional parameters, full schema coverage, and an output schema, the description provides sufficient context to invoke it correctly. It clarifies the default, the accepted health check values, and the behavior of 'all', leaving no major gap for an agent.

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

Parameters4/5

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

Schema description coverage is 100%, but the description adds value by explaining what each health_type value actually checks (e.g., 'connection - checks the number of connection and their utilization'). This goes beyond the schema's bare enum list and helps an agent choose the right parameter value.

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 opens with a specific verb and resource ('Analyzes database health') and then itemizes all health check categories. This lets an agent distinguish it from sibling tools like analyze_workload_indexes and execute_sql without inspecting schemas.

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

Usage Guidelines3/5

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

The description explains how to narrow the scope using health_type and the default 'all', but it does not explicitly compare this tool with alternatives or state when to prefer it over analyze_workload_indexes or analyze_query_indexes. The usage context is implied by the health-check list rather than directly specified.

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