Skip to main content
Glama

analyze_workload_indexes

Read-onlyIdempotent

Recommends indexes for the current pg_stat_statements workload by comparing planner costs with hypothetical indexes, without creating any indexes.

Instructions

Recommend indexes for the current workload in pg_stat_statements, by comparing planner costs with hypothetical indexes (hypopg). Nothing is created.

Input Schema

NameRequiredDescriptionDefault
max_index_size_mbNoSize budget for all recommended indexes together, in MB (default 10000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already establish readOnlyHint=true, destructiveHint=false and idempotentHint=true, so the safety profile is covered. The description adds real method context — planner-cost comparison using hypothetical indexes — and 'Nothing is created' reinforces non-destructiveness. However, it omits that the hypopg extension must be installed and says nothing about the cost/runtime of scanning the whole workload.

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?

Two compact sentences, front-loaded with the action and resource, with the method and the no-write guarantee following. Nothing is wasted, though the method clause could be trimmed or the space spent on prerequisites.

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?

There is no output schema, so the description should convey what a recommendation looks like and what an agent gets back; it does not. For a workload-wide analysis tool, the absence of prerequisite and runtime notes leaves a moderate gap, though the safety story is complete via annotations.

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 coverage is 100% and the single parameter already documents its meaning and default of 10000 MB. The description adds no interpretation of max_index_size_mb, such as how the budget is allocated across recommendations or what happens when it is exceeded, which is the baseline expectation when the schema does the work.

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?

Names a specific verb and resource: 'Recommend indexes for the current workload in pg_stat_statements'. The workload-level scope implicitly contrasts with the sibling analyze_query_indexes, and the hypopg method is stated, so an agent can tell what it does. It stops short of explicitly naming the single-query alternative.

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?

Scoping to 'the current workload in pg_stat_statements' implies when it applies, but there is no explicit when-to-use vs when-not or direct routing to analyze_query_indexes for single-query tuning or to get_top_queries for identifying candidates first.

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