Skip to main content
Glama

tune_query

Read-only

Opens a performance tuning session for an Azure SQL query, capturing actual execution plans and Query Store history for evidence-based analysis.

Instructions

Compatibility initializer only: open a performance case/session and collect evidence. It does not generate or benchmark a rewrite and must not be treated as a completed optimization. Named optimizer profiles use the explicit case/session workflow instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesRead-only SQL query to tune.
analyzeNoWhen true, execute the query to capture an actual plan.
database_nameNoOptional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE.
window_minutesNoQuery Store lookback window for history evidence.
include_raw_xmlNoInclude raw SHOWPLAN XML inline. Defaults to token-safe artifact URI only.
parameter_typesNoOptional exact SQL types for the supplied parameter values.
auto_bind_paramsNoBind @param placeholders from column statistics where possible.
parameter_valuesNoExplicit parameter values for representative execution; prefer this over heuristic statistics/type fallback binding.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

Annotations already declare read-only and non-destructive behavior. The description goes beyond by revealing that the tool only initializes a case/session and collects evidence, does not rewrite or benchmark, and must not be considered a final optimization. This adds meaningful behavioral context without contradicting annotations.

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 core purpose, followed by a critical limitation and an alternative. Every sentence earns its place without redundancy, making the description compact and effective.

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 (8 parameters) and the presence of an output schema, the description adequately explains what the tool does and what it doesn't do. It also provides the essential warning about being an initializer only. Minor gap: it doesn't detail what 'collect evidence' entails, but the sibling tools and output schema cover that context sufficiently.

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?

The input schema has 100% coverage for all 8 parameters with individual descriptions. The tool description adds no parameter-specific information, but the schema already handles parameter semantics fully, so the baseline score of 3 is appropriate.

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 the tool's function: 'open a performance case/session and collect evidence' and explicitly distinguishes it from siblings by noting it does not generate or benchmark a rewrite. This specific verb+resource+scope makes the purpose unambiguous.

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?

The description provides clear context on when to use the tool (as a compatibility initializer) and warns against treating it as a completed optimization. It also names an alternative for named optimizer profiles ('use the explicit case/session workflow instead'), offering exclusionary guidance.

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