Skip to main content
Glama
Elekto MCP for SQL Server

Elekto MCP for SQL Server

Official

Settings that change query plans

get_optimizer_settings
Read-onlyIdempotent

Reports SQL Server settings that affect query compilation—compatibility level, scoped configurations, Query Store, MAXDOP, and trace flags—to diagnose plan changes or server differences.

Instructions

Reports the settings that change how SQL Server compiles queries in one database: the compatibility level and the cardinality estimator it implies, automatic and asynchronous statistics updates, forced parameterization, every database scoped configuration (MAXDOP, LEGACY_CARDINALITY_ESTIMATION, PARAMETER_SNIFFING and the rest) with whether it is the default, the Query Store state, and on the server max degree of parallelism, cost threshold for parallelism and the global trace flags. Use it when a plan changed, or differs between two servers; for one table's statistics use get_table_statistics. A section that cannot be read comes back null, and 'visibility' says why.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "database": "<database>"
    },
    "name": "get_optimizer_settings"
  }
}

Input Schema

NameRequiredDescriptionDefault
databaseYesName of the database as registered in the configuration.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.6.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed world), and the description adds genuinely non-obvious behavior: partially readable results come back null per section, with a 'visibility' field explaining why — critical for correctly interpreting missing data due to permissions or version. It stops short of stating required server permissions or version prerequisites, so it is strong but not exhaustive.

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?

Well front-loaded: purpose first, then the inventory of returned sections, then usage guidance, then the null/visibility caveat. The long enumeration of configurations is dense but each item scopes the tool; it could be trimmed slightly (e.g., "and the rest") without loss.

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?

No output schema exists, so the description carries the burden of describing returns — and it does, naming each section, the server-level values, and how unreadable sections surface as null with a 'visibility' reason. For a single-parameter diagnostic tool this is enough to call and interpret correctly.

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?

There is a single required parameter and schema coverage is 100%, so the schema already documents the 'database' argument. The description only implies the one-database scope ("in one database") without adding format or resolution nuances beyond what the schema states. Baseline 3 applies.

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?

States a specific verb ("Reports") and a precisely scoped resource (settings that change how SQL Server compiles queries in one database), then enumerates the concrete categories returned: compatibility level, cardinality estimator, stats updates, forced parameterization, database scoped configurations, Query Store state, and server MAXDOP/cost threshold/trace flags. This is clearly distinguishable from siblings such as get_table_statistics and get_query_plan_summary.

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

Usage Guidelines5/5

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

Gives explicit triggers ("when a plan changed, or differs between two servers") and names the alternative plus the condition that selects it ("for one table's statistics use get_table_statistics"). Nothing about when to reach for this tool is left to inference.

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