Skip to main content
Glama
gokiwitech

pgwarden-mcp

by gokiwitech

analyze_query_indexes

Read-only

Identify optimal database indexes by analyzing up to 10 SQL queries, offering index recommendations to improve query performance.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoMethod to use for analysisdta
queriesYesList of Query strings to analyze
databaseNoOptional. Alias of the configured database to query. Omit it when the server has only one database configured. When several are configured this parameter is required - call list_databases first to learn the valid aliases.
max_index_size_mbNoMax index size in MB

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations provide readOnlyHint=true, so the description only needs to add context beyond that. It mentions 'recommend optimal indexes' which aligns with a read-only analysis. However, it does not disclose that the 'method' parameter (dta vs llm) may involve different costs, external calls, or result variations, nor any rate limits. The description adds minimal behavioral detail beyond the annotation.

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?

A single, well-formed sentence that is front-loaded with the core action and scope. Every word earns its place; there is no redundancy or filler.

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?

Given an output schema exists (as indicated by context signals) and the input schema covers all parameters, the description need not explain return values. It adequately states the purpose and the batch limit. However, it does not clarify the significance of the 'method' parameter (dta vs llm) or mention potential long execution times for analysis, which could be relevant for an agent deciding to invoke it. These are minor gaps given the schema already documents the parameters.

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. The description adds the 'up to 10' constraint on the 'queries' array, which is not present in the schema (schema only says array of strings). This is valuable semantic information that helps agents understand the limit. It does not explain 'method' or 'database' beyond what the schema provides, but that is acceptable given full schema coverage.

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?

The description states a clear verb ('Analyze') and resource ('a list of SQL queries') with an outcome ('recommend optimal indexes'). It is specific about the input scope (up to 10 queries), which helps differentiate from the sibling 'analyze_workload_indexes' that likely targets a workload. However, it does not explicitly name that sibling or explain the difference, so it loses a point.

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?

No guidance is given on when to use this tool versus alternatives like 'analyze_workload_indexes' or 'explain_query'. The description implies use for analyzing a batch of queries but does not state exclusions or conditions, leaving the agent to infer. This is a clear gap for a tool with several analytical siblings.

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