Skip to main content
Glama
Snarloff

pg-multi-mcp

by Snarloff

analyze_query_indexes

Read-only

Analyzes up to 10 SQL queries and recommends indexes to improve PostgreSQL query performance and reduce unnecessary table scans.

Instructions

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

Input Schema

NameRequiredDescriptionDefault
queriesYesList of Query strings to analyze
connectionNoNome ou alias da conexão (veja list_connections). Se omitido, usa a conexão ativa ou a padrão.
max_index_size_mbNoMax index size in MB

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

readOnlyHint=true already tells the agent nothing is mutated, and the description adds that the output is a set of index recommendations rather than executed DDL, which is genuinely useful. It still omits engine/dialect assumptions, whether the analysis is against real statistics, and any cost or latency implications.

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?

A single front-loaded sentence with no filler or repetition. It is efficient, though its brevity is achieved partly by omitting usage context rather than by tightening redundancy.

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?

An output schema exists, so return values need not be explained, and readOnlyHint covers safety. However, for a tool with three parameters, an unfamiliar connection-resolution rule, and a near-identical sibling, the one-sentence description leaves the agent without enough to choose or configure it confidently.

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?

Schema coverage is 100%, so baseline is 3, but the description adds a constraint the schema does not encode: the 'queries' array is capped at 10 entries. It says nothing about the behavior of 'connection' (fallback to active/default) or 'max_index_size_mb' beyond the schema, so it does not reach 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource pair ('Analyze a list of SQL queries and recommend optimal indexes') with clear scope. It does not explicitly distinguish itself from the sibling analyze_workload_indexes, which is the nearest alternative, so the agent must infer the difference from names alone.

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

Usage Guidelines2/5

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

The only guidance is the implicit 'up to 10' cap. There is no statement of when to prefer this over analyze_workload_indexes, nor any prerequisite (e.g., that queries must be valid for the connected engine, or that a connection must be selected first).

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