Skip to main content
Glama
isdaniel

PostgreSQL-Performance-Tuner-Mcp

find_unused_indexes

Read-onlyIdempotent

Identify unused, duplicate, and overlapping indexes in PostgreSQL to reduce storage space and improve database performance by removing unnecessary indexes.

Instructions

Find indexes that are not being used or are duplicates.

Note: This tool analyzes only user/client indexes and excludes system catalog indexes (pg_catalog, information_schema, pg_toast). It focuses on your application's custom tables only.

Identifies:

  • Indexes with zero or very few scans since last stats reset

  • Duplicate indexes (same columns in same order)

  • Overlapping indexes (one index is a prefix of another)

Removing unused indexes can:

  • Reduce storage space

  • Speed up INSERT/UPDATE/DELETE operations

  • Reduce vacuum and maintenance overhead

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schema_nameNoSchema to analyze (default: public)public
min_size_mbNoMinimum index size in MB to include
include_duplicatesNoInclude analysis of duplicate/overlapping indexes
Behavior4/5

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

Annotations already indicate read-only, non-destructive, and idempotent behavior, which the description does not contradict. The description adds valuable context beyond annotations: it specifies scope limitations (excludes system catalogs, focuses on custom tables), identifies what gets analyzed (zero/few scans, duplicates, overlaps), and lists benefits of acting on results (storage reduction, speed improvements). However, it lacks details on rate limits or exact output format.

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?

The description is well-structured and appropriately sized, with a clear purpose statement upfront, followed by a note on scope, a bulleted list of what it identifies, and a bulleted list of benefits. Every sentence adds value without redundancy, and it is front-loaded with the core functionality.

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?

Given the tool's moderate complexity (analysis tool with 3 parameters), rich annotations (read-only, idempotent), and no output schema, the description is mostly complete: it covers purpose, scope, what it identifies, and benefits. However, it does not detail the output format or potential limitations (e.g., analysis time, database impact), leaving a minor gap for an agent to fully understand results.

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 all parameters (schema_name, min_size_mb, include_duplicates) with descriptions and defaults. The description does not add further meaning or syntax details for these parameters, such as how 'min_size_mb' affects analysis or examples of schema names. Baseline 3 is appropriate as the schema handles parameter documentation adequately.

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 clearly states the tool's purpose with specific verbs ('find', 'analyzes', 'identifies') and resources ('indexes'), distinguishing it from siblings like 'analyze_index_bloat' or 'get_index_recommendations' by focusing on unused/duplicate detection rather than bloat or recommendations. It explicitly lists what it identifies: indexes with few scans, duplicates, and overlapping indexes.

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 provides clear context on when to use this tool: for analyzing user/client indexes on custom tables, excluding system catalogs. It implicitly suggests usage for performance optimization (e.g., 'Removing unused indexes can...'), but does not explicitly state when not to use it or name specific alternatives among siblings, such as 'analyze_index_bloat' for different analysis types.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/isdaniel/pgtuner-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server