Skip to main content
Glama

Index health

index_health

Reports unused and redundant PostgreSQL indexes across user schemas, including sizes and wasted bytes, and suggests candidates to review without dropping any index.

Instructions

Report the health of every index in user schemas: indexes never scanned (excluding primary-key and unique indexes, which enforce integrity) and indexes made redundant by a wider composite index on the same table, with sizes and wasted bytes. Suggestions only — this tool never drops an index.

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

Input Schema

NameRequiredDescriptionDefault
schemaNoOnly check indexes in this schema, e.g. "public". Defaults to all user schemas.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does well: it declares the tool is advisory only, never drops indexes, and explains that primary-key and unique indexes are excluded because they enforce integrity. It stops short of stating whether any privileges are required or how expensive the catalog scan is.

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?

Two sentences, front-loaded with the core action and findings, with zero filler; the exclusion rationale and the read-only guarantee each earn their place.

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 diagnostic with no output schema and no annotations, the description covers the action, the categories of findings, the sizes/wasted-bytes payload, and the safety stance. Only minor operational details, such as privileges or the exact result shape, are left unstated.

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?

There is only one optional parameter and schema description coverage is 100%, so the schema already documents the example value and the 'all user schemas' default. The description's phrase 'in user schemas' merely echoes that default rather than adding new meaning.

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 gives a specific verb and resource ('Report the health of every index in user schemas') and sharpens it with the two findings it surfaces: never-scanned indexes and redundant indexes. It never names a sibling such as suggest_indexes, so the differentiation is implied by scope rather than stated.

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 sentence 'Suggestions only — this tool never drops an index' sets a boundary on what the tool will do, which implicitly tells an agent this is a diagnostic step, but there is no explicit when-to-use or when-not-to-use guidance and no pointer to alternatives like suggest_indexes or table_stats.

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