Skip to main content
Glama
isdaniel

PostgreSQL-Performance-Tuner-Mcp

explain_with_indexes

Read-onlyIdempotent

Analyze PostgreSQL query performance with proposed indexes before implementation. Compare execution plans to determine if new indexes would improve performance without creating them.

Instructions

Run EXPLAIN on a query, optionally with hypothetical indexes.

This tool allows you to see how a query would perform with proposed indexes WITHOUT actually creating them. Requires HypoPG extension for hypothetical testing.

Use this to:

  • Compare execution plans with and without specific indexes

  • Test if a proposed index would be used

  • Estimate the performance impact of new indexes

Returns both the original and hypothetical execution plans for comparison.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe SQL query to explain
hypothetical_indexesNoList of hypothetical indexes to test
analyzeNoWhether to use EXPLAIN ANALYZE (executes the query)
Behavior4/5

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

The description adds valuable behavioral context beyond what annotations provide. While annotations indicate read-only, non-destructive, and idempotent operations, the description clarifies that this tool 'requires HypoPG extension for hypothetical testing' and that it 'returns both the original and hypothetical execution plans for comparison.' This provides important implementation details and output behavior that annotations don't cover.

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 perfectly structured and concise - it starts with the core purpose, explains the unique value proposition, provides clear usage scenarios in bullet points, and ends with what the tool returns. Every sentence adds value with zero wasted words, and it's appropriately front-loaded with the most important information.

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 tool with rich annotations (readOnlyHint, idempotentHint, destructiveHint all specified) and complete schema coverage, the description provides excellent context about the tool's unique capabilities and constraints. The only minor gap is the lack of output schema, but the description does specify what the tool returns ('both the original and hypothetical execution plans'), which partially compensates.

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?

With 100% schema description coverage, the input schema already documents all parameters thoroughly. The description doesn't add significant parameter semantics beyond what's in the schema, though it does provide context about the 'hypothetical_indexes' parameter's purpose ('to test without actually creating them'). This meets the baseline expectation when schema coverage is complete.

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 ('Run EXPLAIN on a query') and resources ('hypothetical indexes'), distinguishing it from siblings like analyze_query or get_index_recommendations. It explicitly mentions the unique capability of testing indexes without creating them, which sets it apart from other analysis tools.

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 on when to use this tool ('to compare execution plans', 'test if a proposed index would be used', 'estimate performance impact'), and it implicitly distinguishes from alternatives by mentioning the HypoPG extension requirement. The sibling tools list shows clear alternatives like analyze_query (without hypothetical testing) and manage_hypothetical_indexes (which likely creates actual indexes).

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