Skip to main content
Glama
sdebruyn

fabric-dw-mcp-cli

by sdebruyn

get_query_plan

Generate estimated SQL execution plans in XML, tree, JSON, or Mermaid format without executing the query. Works for Fabric Warehouse and SQL Analytics Endpoints.

Instructions

Capture the estimated SHOWPLAN_XML execution plan for a SQL query without executing it.

This tool does NOT execute the query — it only retrieves the estimated execution plan as SHOWPLAN_XML. Because no data is modified, this tool is permitted even under FABRIC_MCP_READONLY=1.

The plan XML uses the standard namespace http://schemas.microsoft.com/sqlserver/2004/07/showplan and can be opened in SSMS, Azure Data Studio, or uploaded to pastetheplan.com for visual analysis.

Since the query is not executed, DDL/DML query text is safe to plan without modifying any data.

Supports both Warehouse and SQL Analytics Endpoint items.

Format options:

  • "xml" (default, backwards-compatible) — returns the raw SHOWPLAN_XML string in plan_xml. Existing callers relying on {"plan_xml": str} continue to work unchanged.

  • "tree" — parses the XML into a native nested list of dicts (one entry per statement) in plan. Best for agent reasoning over the plan structure.

  • "json" — same tree, serialised to an indented JSON string in plan_json. Ready to write out or pass through as compact text.

  • "mermaid" — renders a Mermaid flowchart TD diagram string in mermaid. Paste into mermaid.live or embed in GitHub Markdown.

Artifact formats (SVG/HTML/DOT) are CLI-only. They write files to disk and are only available via fdw sql plan --format <fmt> -o <file>. The MCP server never writes files (ambiguous cwd, invisible side-effects).

Args: workspace: Workspace name or GUID. item: Warehouse or SQL Analytics Endpoint name or GUID. query: SQL statement to generate an estimated execution plan for. format: Output format — one of "xml" (default), "tree", "json", or "mermaid".

Returns: A dict whose shape depends on format:

- ``xml``     → ``{"format": "xml",     "plan_xml":   str}``
- ``tree``    → ``{"format": "tree",    "plan":       list[dict]}``
- ``json``    → ``{"format": "json",    "plan_json":  str}``
- ``mermaid`` → ``{"format": "mermaid", "mermaid":    str}``

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemYes
queryYes
formatNoxml
workspaceYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully discloses behavior: no query execution, no side effects, format options, and artifact formats are CLI-only. It contradicts no 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 well-structured with clear sections, bullet points, and a format table. While somewhat lengthy, each section adds value. It is front-loaded with the most critical info.

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 presence of many sibling tools and an output schema, the description is complete. It covers purpose, usage guidelines, parameters, format options, and return types, leaving no gaps for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 0% schema description coverage, the description provides a detailed Args section explaining each parameter, including format enum options with defaults. This adds substantial meaning beyond the raw schema.

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 it captures the estimated execution plan as SHOWPLAN_XML without executing the query. It distinguishes itself from sibling tools like execute_sql that actually run queries.

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?

It explicitly states when to use this tool (to get an execution plan without execution) and when not to (requires actual execution). It also mentions safety under FABRIC_MCP_READONLY=1 and that DDL/DML is safe because no data is modified.

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/sdebruyn/fabric-dw-mcp-cli'

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