Skip to main content
Glama
BACH-AI-Tools

Postgres MCP Pro

analyze_query_indexes

Analyzes SQL queries to recommend optimal PostgreSQL indexes for improved database performance and query efficiency.

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
Behavior2/5

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

With no annotations, the description carries full burden but lacks behavioral details. It doesn't disclose whether this is a read-only analysis, if it requires database permissions, execution time, or output format. The 10-query limit is mentioned, but other constraints like rate limits or side effects are not addressed.

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, front-loaded sentence with zero waste. It efficiently conveys the core purpose and key constraint (up to 10 queries) without unnecessary elaboration, making it highly scannable and actionable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 3 parameters, 100% schema coverage, and no output schema, the description is minimally complete. It states the purpose clearly but lacks behavioral context (e.g., analysis method implications, output details). Given the complexity of index recommendation, more guidance on usage and results would improve completeness.

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 fully documents parameters. The description adds no additional meaning beyond implying 'up to 10' queries, which is already covered by the schema's array type. Baseline 3 is appropriate as the schema handles parameter semantics 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 specific action ('analyze'), the resource ('SQL queries'), and the outcome ('recommend optimal indexes'). It distinguishes from siblings like 'analyze_db_health' (general health) and 'explain_query' (execution plan) by focusing on index recommendations for multiple 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 context through 'list of (up to 10) SQL queries,' suggesting it's for batch analysis, but doesn't explicitly state when to use this vs. alternatives like 'analyze_workload_indexes' or 'explain_query.' No guidance on prerequisites or exclusions 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/BACH-AI-Tools/bach--postgres-mcp'

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