get_query_plan
Get the estimated execution plan for a SQL query without executing it. Retrieve SHOWPLAN_XML to analyze and optimize query performance in 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.
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.
Returns:
A dict with key plan_xml (str) containing the SHOWPLAN_XML string.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | Yes | ||
| item | Yes | ||
| query | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||