Skip to main content
Glama
call518

MCP PostgreSQL Operations

get_index_usage_stats

Analyze PostgreSQL index usage statistics to identify unused indexes and optimize database performance by providing scan counts and tuple return data.

Instructions

[Tool Purpose]: Analyze usage rate and performance statistics of all indexes in database

[Exact Functionality]:

  • Analyze usage frequency and efficiency of all indexes

  • Identify unused indexes

  • Provide scan count and tuple return statistics per index

[Required Use Cases]:

  • When user requests "index usage rate", "index performance", "unnecessary indexes", etc.

  • When database performance optimization is needed

  • When index cleanup or reorganization is required

[Strictly Prohibited Use Cases]:

  • Requests for index creation or deletion

  • Requests for index reorganization or REINDEX execution

  • Requests for statistics reset

Args: database_name: Database name to analyze (uses default database if omitted)

Returns: Index usage statistics including schema, table, index name, scans, and tuples read

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's functionality ('analyze usage frequency', 'identify unused indexes', 'provide scan count and tuple return statistics'), scope ('all indexes in database'), and limitations (prohibited use cases). However, it doesn't mention potential performance impact, permissions required, or data freshness, leaving some behavioral aspects unclear.

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 well-structured with clear sections ([Tool Purpose], [Exact Functionality], etc.) and front-loaded key information. However, some sections like 'Exact Functionality' could be more concise, and the overall length is moderate but not minimal.

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?

Given the tool's complexity (analyzing index usage), no annotations, and the presence of an output schema (which handles return values), the description is complete. It covers purpose, functionality, use cases, prohibitions, parameters, and returns, providing sufficient context for an AI agent to understand and invoke the tool correctly.

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?

The schema description coverage is 0%, so the description must compensate. It adds meaningful context for the single parameter by explaining 'database_name: Database name to analyze (uses default database if omitted)', clarifying the optional nature and default behavior. This goes beyond the basic schema information, though it doesn't detail format constraints or examples.

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 explicitly states the tool's purpose as 'Analyze usage rate and performance statistics of all indexes in database' with specific verbs ('analyze', 'identify', 'provide') and resources ('indexes', 'database'). It clearly distinguishes from siblings like 'get_index_io_stats' by focusing on usage frequency and efficiency rather than I/O statistics.

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

Usage Guidelines5/5

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

The description provides explicit guidance with 'Required Use Cases' (e.g., 'When user requests index usage rate', 'When database performance optimization is needed') and 'Strictly Prohibited Use Cases' (e.g., 'Requests for index creation or deletion', 'Requests for index reorganization'). This clearly defines when to use this tool versus alternatives.

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/call518/MCP-PostgreSQL-Ops'

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