Skip to main content
Glama

optimize_indexes

Read-only

Analyze workload from Query Store to generate and rank index candidates, balancing read benefit, size, and write overhead for budget-constrained recommendations.

Instructions

Run the index optimization engine: analyzes workload from Query Store, generates index candidates from execution plans and DMVs, estimates sizes, scores using Pareto optimization (read benefit vs size vs write overhead), and returns budget-constrained ranked recommendations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
betaNoWrite penalty weight (higher = avoid indexes on write-heavy tables).
alphaNoSize penalty weight (higher = prefer smaller indexes).
top_nNoNumber of top queries to analyze.
budget_mbNoMax total index size in MB. None = unlimited.
database_nameNoOptional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE.
window_minutesNoQuery Store lookback window in minutes.
min_improvement_pctNoMinimum impact percentage to include a candidate.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

Annotations declare readOnlyHint=true and destructiveHint=false, establishing a safe read-only profile. The description adds process context (Query Store, DMVs, Pareto optimization) but does not disclose additional behavioral traits such as execution time, resource consumption, or whether it applies changes (it says returns recommendations, implying no mutations). This is adequate but not rich beyond the annotations.

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?

The description is a single dense sentence that efficiently communicates the core algorithm and output. It is front-loaded with the verb phrase 'Run the index optimization engine'. While it could be split for readability, every clause adds useful information without redundancy or fluff.

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 the tool's complexity (7 parameters, output schema present), the description covers the main algorithm (Pareto optimization), data sources (Query Store, DMVs), and output (ranked recommendations). It omits potential caveats like prerequisites or performance impact, but the output schema handles return details and the annotations cover safety. It is sufficiently complete for a well-structured tool.

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% with each parameter clearly explained (e.g., alpha for size penalty, beta for write penalty, budget_mb for max size). The description's mention of 'budget-constrained' and 'read benefit vs size vs write overhead' loosely maps to parameters but adds no new syntax detail. Baseline of 3 applies since the schema carries the full semantic weight.

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 a specific action ('Run the index optimization engine') and details the full workflow: analyzing workload from Query Store, generating candidates, estimating sizes, scoring with Pareto optimization, and returning ranked recommendations. It distinguishes itself from sibling tools like analyze_workload_indexes by focusing on the complete optimization process rather than just analysis.

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 description provides no guidance on when to use this tool versus alternatives. It does not mention when it is appropriate to run the engine, prerequisites (e.g., Query Store enabled), or contrast with simpler analysis tools. The only implied usage is 'run the engine', which is tautological and offers no decision support.

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/akaalholdings/azure-sql-mcp'

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