Skip to main content
Glama

analyze_query_indexes

Read-only

Extracts missing-index hints from estimated execution plans for up to 10 SQL queries, helping identify potential index improvements.

Instructions

Extract SQL Server missing-index hints from estimated plans for up to 10 queries. A per-query missing_index_count of zero means no Showplan hint was emitted for that plan. The filtered recommendations can also be empty when an existing index already covers an emitted hint; neither condition proves that no index could improve the query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesYesList of SQL SELECT queries to analyze (max 10).
database_nameNoOptional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE.
parameter_typesNoOptional exact SQL types keyed by parameter name and shared across the supplied queries.
auto_bind_paramsNoWhen true, automatically binds @param placeholders in queries using column statistics before analyzing.
parameter_valuesNoExplicit parameter values for the supplied queries.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description adds significant behavioral nuance beyond the annotations: it explains the meaning of a zero missing_index_count, the possibility of empty filtered recommendations due to existing covered indexes, and explicitly warns that neither condition proves no index could improve the query. This is valuable interpretive guidance.

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?

Two sentences, front-loaded with the main purpose, and each sentence earns its place. The second sentence provides a critical interpretation caveat without unnecessary verbosity.

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

Completeness5/5

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

Given the output schema exists and annotations cover safety, the description sufficiently explains scope, expected results, and a key edge case. It is complete for its complexity and does not need to duplicate structured fields.

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?

Input schema coverage is 100%, so the baseline is 3. The description does not add any parameter-specific semantics beyond the schema (e.g., it doesn't explain database_name or auto_bind_params), and the 'up to 10 queries' limit is already present in the schema's maxItems constraint.

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 states a specific verb+resource ('Extract SQL Server missing-index hints from estimated plans') and clearly scopes it to up to 10 queries. The per-query focus distinguishes it from workload-level sibling tools such as analyze_workload_indexes.

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

Usage Guidelines4/5

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

Clear context is provided: it handles up to 10 queries individually and uses estimated plans. However, it does not explicitly name alternatives or state when not to use this tool, leaving exclusions implied rather than explicit.

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