Skip to main content
Glama

analyze_db_health

Read-only

Runs selected or all PostgreSQL health checks across indexes, connections, vacuum, sequences, replication, buffers, and constraints to surface database issues.

Instructions

Analyzes database health. Here are the available health checks:

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

  • connection - checks the number of connections and their utilization

  • vacuum - checks transaction id wraparound and dead rows

  • 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.

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

Input Schema

NameRequiredDescriptionDefault
health_typeNoOptional. Valid values are: all, buffer, connection, constraint, index, replication, sequence, vacuum.all

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=false and idempotentHint=false, so the safety profile is covered by structured data. The description adds the default-scope behavior ('all' runs everything) and the list-selection semantics, but says nothing about relative cost of running all checks versus one, or whether results are reported per check.

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?

Purpose is front-loaded in the first sentence, followed by a scannable bullet list of check names with one-line meanings; no filler prose. The only inefficiency is that the check names partially duplicate the values already listed in the health_type schema description.

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?

For a single-optional-parameter, read-only, non-destructive diagnostic tool with no output schema and rich annotations, the description supplies everything needed to invoke it correctly, including the full check catalog and default. The remaining gap is cost/expected latency when 'all' is used, which an agent would reasonably want to know.

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 coverage is 100%, so the baseline is 3. The description earns above baseline by clarifying that the argument accepts a comma-separated combination of checks and that omission defaults to 'all' — a capability the schema's enum-style description does not spell out.

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?

States a specific verb and resource ("Analyzes database health") and then enumerates the eight check families it performs, so the agent knows exactly what scope is covered. This also implicitly separates it from siblings like analyze_locks, analyze_query_indexes, and explain_query, which are narrower diagnostics.

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 clearly explains how to invoke it selectively (single check or comma-separated list) and states the default is 'all'. Each bullet describes what the check looks at, which gives context for when a given check is relevant. It stops short of explicit when-not guidance or routing against overlapping siblings such as analyze_query_indexes.

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