Skip to main content
Glama
mirenqinggege

postgres-mcp

analyze_query_indexes

Read-only

Analyze SQL queries to recommend optimal indexes. Improve query performance by identifying missing indexes.

Instructions

Analyze a list of (up to 10) SQL queries and recommend optimal indexes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesYesList of Query strings to analyze
max_index_size_mbNoMax index size in MB
methodNoMethod to use for analysisdta

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint=true, indicating a safe read operation. The description adds that the tool recommends optimal indexes based on the provided queries, with a constraint of up to 10 queries. No behavioral contradictions exist. It provides additional context beyond the annotations, such as the limitation on query count.

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 a single, well-structured sentence that front-loads the core functionality: 'Analyze a list of (up to 10) SQL queries and recommend optimal indexes'. Every part is necessary and no words are wasted.

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 has 3 parameters with complete schema descriptions and an output schema exists, the description covers the essential purpose and constraints. It explains the input (list of queries with a limit) and the output (recommendations). There is no missing information critical for the agent to understand the tool's role.

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 input schema has 100% description coverage, so the baseline is 3. However, the description adds the important constraint that the queries list is limited to 'up to 10', which is not present in the schema description. This adds meaningful context for the 'queries' parameter, improving understanding beyond what the schema alone provides.

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 'Analyze a list of (up to 10) SQL queries and recommend optimal indexes'. It uses a specific verb (analyze) and resource (list of SQL queries), and includes a key constraint (up to 10). This distinguishes it from sibling tool 'analyze_workload_indexes' which likely deals with workloads rather than explicit queries.

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 description implies usage for analyzing a limited set of up to 10 SQL queries, but does not explicitly state when to use this tool versus alternatives. For example, it does not mention when to choose 'analyze_workload_indexes' or other siblings. The context signals show sibling tools, but no guidance on differentiation is provided.

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/mirenqinggege/postgres-mcp'

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