Skip to main content
Glama
sdebruyn

fabric-dw-mcp-cli

by sdebruyn

execute_sql

Run custom SQL queries on Fabric warehouses or SQL Analytics endpoints for data retrieval or modification when predefined tools are not suitable.

Instructions

Execute an arbitrary SQL statement or batch against a warehouse or SQL Analytics Endpoint.

Prefer dedicated tools for common operations: use read_table or read_view to fetch rows, count_table_rows or count_view_rows to count, list_tables, list_views, list_schemas to discover objects, get_table_columns or get_view_columns to inspect schemas, and delete_table, rename_table, or clear_table to mutate. Dedicated tools return structured, typed results with no dialect pitfalls or batch-truncation surprises.

WARNING: this tool executes arbitrary SQL against the target. DDL (DROP, ALTER, TRUNCATE) and DML (DELETE, UPDATE) are permitted unless FABRIC_MCP_READONLY=1 is set. Use only when the user explicitly requests data modification. Default to SELECT when the user's intent is read-only investigation.

Supports both Warehouse and SQL Analytics Endpoint items. Multi-statement batches are allowed; only the last result set is returned. DDL/DML statements that produce no result set return columns=[] and rows=[].

datetime and Decimal column values are pre-serialised to strings. bytes / varbinary columns are base64-encoded and their column names are suffixed with __base64.

For large tables, add a TOP clause or WHERE predicate to the query rather than relying solely on max_rows. The driver fetches at most max_rows + 1 rows (enough to detect truncation) so memory is bounded, but pushing the limit into the query itself is always more efficient.

Args: workspace: Workspace name or GUID. item: Warehouse or SQL Analytics Endpoint name or GUID. query: SQL statement or batch to execute. max_rows: Maximum rows to return (1-10000, default 1000). When the result set is larger the response includes "truncated": true.

Returns: A dict with keys columns (list[str]), rows (list[list[Any]]), rowcount (int; -1 when the driver does not report a count), row_count_returned (int), and truncated (bool).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemYes
queryYes
max_rowsNo
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, the description fully carries the behavioral burden. It discloses arbitrary SQL execution, batch behavior (last result set returned), DDL/DML permissions, serialization of datetimes and decimals, base64 encoding of varbinary, row fetching strategy, truncation detection, and return structure. No contradictions.

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 thorough and well-organized, but slightly lengthy. However, every sentence adds value, covering purpose, guidance, warnings, parameter details, and return info. The structure is logical and front-loaded with critical guidance.

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 tool's complexity (arbitrary SQL, mutation risk, multiple target types, batching, serialization), the description is comprehensive. It covers all key aspects: when to use, behavioral nuances, parameter details, and return format (even with existing output schema). No gaps.

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?

Schema descriptions are absent (0% coverage), but the description explains each parameter in detail: workspace and item as names/GUIDs, query as arbitrary SQL, max_rows with default, range, and behavioral effect (fetches max_rows+1). Adds significant meaning beyond the 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 the tool executes arbitrary SQL against a warehouse or SQL Analytics Endpoint. It lists specific dedicated tools for common operations, distinguishing its general-purpose role from more targeted alternatives.

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?

Provides explicit guidance: prefer dedicated tools for common operations, use only when user explicitly requests data modification, default to SELECT for read-only investigation. Includes warnings about DDL/DML and the READONLY flag.

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