Skip to main content
Glama

analyze_db_health

Run catalog-based PostgreSQL health checks covering connections, idle transactions, long queries, cache hit rate, indexes, constraints, wraparound, sequences, and replication without extensions.

Instructions

Eleven deterministic checks over the system catalog: connections, idle transactions, long queries, cache hit rate, invalid, unused and duplicate indexes, constraints, wraparound, sequences, replication. No extensions required. A check returns skipped, not ok, when the role lacks the privilege or the statistics window is too short to judge; overall_status is unknown when nothing could be checked.

Input Schema

NameRequiredDescriptionDefault
connection_idYesConnection id. See list_connections.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations present, the description carries the behavioral burden and does so well: it discloses that the checks are deterministic and read-only in nature, that they rely on the system catalog and require no extensions, and it defines a non-obvious result semantic — skipped rather than ok when the role lacks privilege or the statistics window is short, and overall_status of unknown when nothing could be checked. That is real signal beyond the schema. It stops short of stating permission prerequisites or expected cost/latency.

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?

Three sentences, all load-bearing: the capability and check inventory come first, the dependency constraint second, the result semantics last. The dense enumeration is the right format for eleven itemized checks, and no sentence restates the tool name or wastes a clause.

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?

The tool is a single-parameter read, and an output schema exists, so return structure need not be explained; the description wisely spends its space on the one thing the schema cannot convey — the skipped/unknown status semantics. The only remaining gap is the absence of guidance on when to reach for this tool over its siblings.

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?

Only one parameter, connection_id, and its schema description already points to list_connections at 100% coverage. The description adds nothing about the parameter, but with full schema coverage the baseline of 3 applies. No compensating detail is needed here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ("Eleven deterministic checks over the system catalog") and enumerates the exact check families: connections, idle transactions, long queries, indexes, constraints, wraparound, sequences, replication. An agent knows instantly this is a health-assessment tool rather than a data-access tool. It doesn't name a sibling, but no sibling overlaps this capability, so the lack of explicit differentiation is minor.

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?

Usage is only implied: the check list makes the health-diagnostic intent apparent, and "No extensions required" hints at a low-friction pre-diagnostic use case. There is no statement of when to call it versus the alternatives (query, explain_query, get_server_info) or of exclusion conditions. An agent can infer the use case but must guess the trigger.

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