# fabric-dw (oci · ghcr.io/sdebruyn/fabric-dw:2026.7.3)

MCP server for Microsoft Fabric Data Warehouses and SQL Analytics Endpoints

- Trust score: 37/100 (low)
- Change this week: 0
- Registry status: active
- Liveness: live
- Owner verified: no
- Last scored: 2026-08-03

## Components

- oci · `ghcr.io/sdebruyn/fabric-dw:2026.7.3`: 37/100 (this document), [markdown](https://verifymcp.io/servers/sdebruyn-fabric-dw-mcp/ghcr-io-sdebruyn-fabric-dw-2026-7-3.md), [page](https://verifymcp.io/servers/sdebruyn-fabric-dw-mcp/ghcr-io-sdebruyn-fabric-dw-2026-7-3)

## Channel facts

- Registry: `oci`
- Package: `ghcr.io/sdebruyn/fabric-dw:2026.7.3`
- Transport: `stdio`

## Trust breakdown

How this component scores in each security and reliability category. Every signal is checked automatically from public evidence about the published package, including repeated runs of it in an isolated sandbox, and we only credit what we can confirm. Scores are 0–100 per category. Scoring method: https://verifymcp.io/docs/scoring (what has changed: https://verifymcp.io/docs/scoring/changelog)

Scored 2026-08-03.

- **Supply Chain Security**: 0/100
  - Malware scan not yet available for this package.
  - CVE data not yet available for this package.
  - Install-script risk not yet assessed.
  - Dependency-health data not yet available.
- **Provenance & Transparency**: 45/100
  - Source repository is publicly reachable at the declared URL.
  - Provenance check failed: no build-provenance attestation is published.
  - Clear OSI-approved license (MIT).
  - Actively maintained (last published 14 days ago).
  - Disclosure check failed: no security disclosure policy was found in the source repository.
- **Schema Quality & AI Usability**: 62/100
  - AI-judged instruction clarity (good).
  - Context-footprint check failed: tool/resource definitions use about 19385 tokens (~161/item across 120 items; 120 tools + 0 resources), over budget; trim descriptions and params.
  - Usage-examples check failed: none of the tools include examples.
- **Stability & Change Management**: 23/100
  - Stability observed for 7 of 30 days with no destabilising changes; credit accrues until the full window elapses.
- **Tool Coverage**: 73/100
  - 100% of tools have a non-trivial description (not blank, and not just the tool's name).
  - 5% of tool parameters carry a description.
  - Structured output schemas are declared (100% of tools); any adoption earns full credit.
- **Capabilities**: 100/100
  - Implements a supported MCP spec version (2025-11-25); the latest is 2026-07-28.

**Unverified: 1 category.** A category scored 0 because we could not verify it: a data source with nothing on this package, evidence we could not reach, or a check we could not run. We only credit what we can confirm.

## Install

### Claude

```bash
claude mcp add sdebruyn-fabric-dw-mcp -- docker run --rm -i ghcr.io/sdebruyn/fabric-dw:2026.7.3
```

### Codex

```bash
codex mcp add sdebruyn-fabric-dw-mcp -- docker run --rm -i ghcr.io/sdebruyn/fabric-dw:2026.7.3
```

### opencode

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "sdebruyn-fabric-dw-mcp": {
      "type": "local",
      "command": [
        "docker",
        "run",
        "--rm",
        "-i",
        "ghcr.io/sdebruyn/fabric-dw:2026.7.3"
      ],
      "enabled": true
    }
  }
}
```

### Hermes

```yaml
mcp_servers:
  sdebruyn-fabric-dw-mcp:
    command: "docker"
    args: ["run", "--rm", "-i", "ghcr.io/sdebruyn/fabric-dw:2026.7.3"]
```

### Other

```json
{
  "mcpServers": {
    "sdebruyn-fabric-dw-mcp": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "ghcr.io/sdebruyn/fabric-dw:2026.7.3"
      ]
    }
  }
}
```

## Changelog

Every change recorded for this component, newest first. Days that predate change tracking, or that we cannot explain, say so: "we were watching and nothing happened" and "we were not watching" are different claims.

### 2026-08-02 (score 37, +3)

- [functional improvement] Stability: unverified → 0.20

### 2026-07-31 (score 34, −3)

- [functional] We updated how we score, so this day's move reflects our rubric, not a change to the server

### 2026-07-27 (score 37, +26)

- [functional improvement] Tool coverage: unverified → 100
- [functional] First check of Schema quality: fail
- [functional] First check of Schema quality: good
- [functional] First check of Tool coverage: 5
- [functional] First check of Tool coverage: 100
- [functional] First check of Schema quality: fail

### 2026-07-26 (score 11)

First indexed and scored.

- [functional] We updated how we score, so this day's move reflects our rubric, not a change to the server

## MCP tools (120)

### `assign_workspace_to_capacity` (~57 tokens)

Assign a workspace to a Fabric capacity.

Args:
    workspace: Workspace name or GUID.
    capacity_id: UUID of the capacity to assign the workspace to.

Input parameters:

- `capacity_id` (string, required)
- `workspace` (string, required)

### `list_capacities` (~44 tokens)

List all Fabric capacities the caller has access to.

Requires the ``Capacity.Read.All`` permission.  Returns a 403
ToolError when the caller lacks that permission.

Output parameters:

- `result` (array)

### `list_workspaces` (~77 tokens)

List all Fabric workspaces the caller has access to.

When a workspace allowlist is configured (via ``FABRIC_MCP_WORKSPACES``
env var or ``[mcp] workspace_allowlist`` in ``config.toml``) only the
workspaces that match the allowlist (by name or GUID) are returned.

Output parameters:

- `result` (array)

### `get_workspace` (~26 tokens)

Return details for a single workspace (name or GUID).

Input parameters:

- `workspace` (string, required)

### `set_workspace_collation` (~174 tokens)

Set the default Data Warehouse collation for a workspace.

Args:
    workspace: Workspace name or GUID.
    collation: Collation to apply.  Fabric Data Warehouse supports a
        fixed set of collations.  Supported values include:

        - ``Latin1_General_100_BIN2_UTF8`` (recommended default)
        - ``Latin1_General_100_CI_AS_KS_WS_SC_UTF8``
        - ``Latin1_General_CI_AS``
        - ``SQL_Latin1_General_CP1_CI_AS``

        Supplying an unsupported value will cause the Fabric API to
        return an error.  See the Fabric documentation for the full
        list of supported collations.

Input parameters:

- `collation` (string, required)
- `workspace` (string, required)

### `list_warehouses` (~89 tokens)

List all warehouses and SQL analytics endpoints in a workspace.

Args:
    workspace: Workspace name or GUID.  Optional when *all_workspaces*
        is ``True``; required otherwise.
    all_workspaces: When ``True``, ignore *workspace* and aggregate
        results across every workspace the caller can see.

Input parameters:

- `all_workspaces` (boolean)
- `workspace`

Output parameters:

- `result` (array)

### `get_warehouse` (~34 tokens)

Return details for a single warehouse (name or GUID).

Input parameters:

- `warehouse` (string, required)
- `workspace` (string, required)

### `create_warehouse` (~214 tokens)

Create a new Warehouse in a workspace.

Args:
    workspace: Workspace name or GUID.
    name: Display name for the new warehouse.
    collation: Optional default collation for the new warehouse.
        Fabric Data Warehouse supports a fixed set of collations.
        Supported values include:

        - ``Latin1_General_100_BIN2_UTF8`` (recommended default)
        - ``Latin1_General_100_CI_AS_KS_WS_SC_UTF8``
        - ``Latin1_General_CI_AS``
        - ``SQL_Latin1_General_CP1_CI_AS``

        When omitted, the workspace default collation is used.
        Supplying an unsupported value will cause the Fabric API to
        return an error.  See the Fabric documentation for the full
        list of supported collations.
    description: Optional description for the new warehouse.

Input parameters:

- `collation`
- `description`
- `name` (string, required)
- `workspace` (string, required)

### `rename_warehouse` (~46 tokens)

Rename a Warehouse (and optionally update its description).

Input parameters:

- `description`
- `new_name` (string, required)
- `warehouse` (string, required)
- `workspace` (string, required)

### `delete_warehouse` (~27 tokens)

Delete a Warehouse.

Input parameters:

- `warehouse` (string, required)
- `workspace` (string, required)

### `takeover_warehouse` (~29 tokens)

Take ownership of a Warehouse.

Input parameters:

- `warehouse` (string, required)
- `workspace` (string, required)

### `list_sql_endpoints` (~87 tokens)

List all SQL analytics endpoints in a workspace.

Args:
    workspace: Workspace name or GUID.  Optional when *all_workspaces*
        is ``True``; required otherwise.
    all_workspaces: When ``True``, ignore *workspace* and aggregate
        results across every workspace the caller can see.

Input parameters:

- `all_workspaces` (boolean)
- `workspace`

Output parameters:

- `result` (array)

### `get_sql_endpoint` (~36 tokens)

Return details for a single SQL analytics endpoint (name or GUID).

Input parameters:

- `endpoint` (string, required)
- `workspace` (string, required)

### `refresh_sql_endpoint_metadata` (~156 tokens)

Refresh metadata for a SQL analytics endpoint (sync from the underlying Lakehouse).

This is a long-running operation (LRO) that is polled to completion.
Returns a list of per-table sync results.

Args:
    workspace: Workspace name or GUID.
    endpoint: SQL analytics endpoint name or GUID.
    recreate_tables: When ``True``, drop and recreate all tables during
        the refresh.  Use to resolve inconsistencies or force a clean
        rebuild.  **Destructive** — use with caution.  Requires
        ``FABRIC_MCP_ALLOW_DESTRUCTIVE=1`` when enabled.

Input parameters:

- `endpoint` (string, required)
- `recreate_tables` (boolean)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `list_item_permissions` (~113 tokens)

Return principals with access to a Warehouse or SQL Analytics Endpoint item.

Uses the Fabric admin API.  Accepts both Data Warehouses and SQL Analytics
Endpoints -- the item kind is resolved automatically from its GUID.

Requires Fabric Administrator role (admin API).

See https://learn.microsoft.com/en-us/fabric/admin/microsoft-fabric-admin for details.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.

Input parameters:

- `item` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `list_sql_permissions` (~159 tokens)

List T-SQL database permissions from sys.database_permissions.

Reads from sys.database_permissions joined to sys.database_principals.
Returns DATABASE, SCHEMA, and OBJECT class securables with readable names.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    principal: Filter by principal name (optional).
    schema: Filter by schema name -- returns SCHEMA class rows for this
        schema (optional).
    object_name: Filter by qualified object name ``<schema>.<object>``
        -- returns OBJECT class rows for this object (optional).

Input parameters:

- `item` (string, required)
- `object_name`
- `principal`
- `schema`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `list_database_principals` (~100 tokens)

List database principals from sys.database_principals.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    principal_type: Filter by type -- ``"user"`` for users, ``"role"`` for
        database roles, ``"all"`` or omit for no filter.

Input parameters:

- `item` (string, required)
- `principal_type`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `my_permissions` (~94 tokens)

Return permissions for the current connection via sys.fn_my_permissions.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    scope: Scope string -- ``"database"`` (default), ``"schema:<name>"``,
        or ``"object:<schema>.<object>"``.

Input parameters:

- `item` (string, required)
- `scope`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `grant_permission` (~346 tokens)

Grant permissions on a securable to a principal.

Executes ``GRANT <permissions> ON <scope> TO <principal>``.
Blocked by ``FABRIC_MCP_READONLY``.  Does NOT require
\``FABRIC_MCP_ALLOW_DESTRUCTIVE``.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    permissions: Comma-separated permission tokens (e.g. ``"SELECT,INSERT"``).
    principal: Grantee principal name (Entra UPN, app GUID, or role name).
    scope: Securable class -- ``"DATABASE"`` (default), ``"SCHEMA"``, or
        ``"OBJECT"``.
    schema: Schema name (required when scope is ``"SCHEMA"``).
    object_name: Qualified object name ``<schema>.<object>`` (required when
        scope is ``"OBJECT"``).
    with_grant_option: When ``True``, allows the grantee to grant the
        permission to others (adds ``WITH GRANT OPTION``).
    columns: Optional list of column names for column-level security
        (OBJECT scope only; permissions must be SELECT, UPDATE, or
        REFERENCES). Pass ``None`` (omit) for no column restriction.
        Passing an empty list raises a ``ToolError``.

Input parameters:

- `columns`
- `item` (string, required)
- `object_name`
- `permissions` (string, required)
- `principal` (string, required)
- `schema`
- `scope` (string)
- `with_grant_option` (boolean)
- `workspace` (string, required)

### `deny_permission` (~303 tokens)

Deny permissions on a securable to a principal.

Executes ``DENY <permissions> ON <scope> TO <principal>``.
Blocked by ``FABRIC_MCP_READONLY``.  Does NOT require
\``FABRIC_MCP_ALLOW_DESTRUCTIVE``.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    permissions: Comma-separated permission tokens (e.g. ``"SELECT"``).
    principal: Principal name to deny (Entra UPN, app GUID, or role name).
    scope: Securable class -- ``"DATABASE"`` (default), ``"SCHEMA"``, or
        ``"OBJECT"``.
    schema: Schema name (required when scope is ``"SCHEMA"``).
    object_name: Qualified object name ``<schema>.<object>`` (required when
        scope is ``"OBJECT"``).
    columns: Optional list of column names for column-level security
        (OBJECT scope only; permissions must be SELECT, UPDATE, or
        REFERENCES). Pass ``None`` (omit) for no column restriction.
        Passing an empty list raises a ``ToolError``.

Input parameters:

- `columns`
- `item` (string, required)
- `object_name`
- `permissions` (string, required)
- `principal` (string, required)
- `schema`
- `scope` (string)
- `workspace` (string, required)

### `revoke_permission` (~402 tokens)

Revoke permissions on a securable from a principal.

Executes ``REVOKE <permissions> ON <scope> FROM <principal>``.
Blocked by ``FABRIC_MCP_READONLY``.  Requires
\``FABRIC_MCP_ALLOW_DESTRUCTIVE=1`` because revoke removes an existing
permission (destructive operation).

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    permissions: Comma-separated permission tokens (e.g. ``"SELECT,INSERT"``).
    principal: Principal name to revoke from (Entra UPN, app GUID, or role name).
    scope: Securable class -- ``"DATABASE"`` (default), ``"SCHEMA"``, or
        ``"OBJECT"``.
    schema: Schema name (required when scope is ``"SCHEMA"``).
    object_name: Qualified object name ``<schema>.<object>`` (required when
        scope is ``"OBJECT"``).
    columns: Optional list of column names for column-level security
        (OBJECT scope only; permissions must be SELECT, UPDATE, or
        REFERENCES). Pass ``None`` (omit) for no column restriction.
        Passing an empty list raises a ``ToolError``.
    grant_option_only: When ``True``, revokes only the grant option (adds
        ``GRANT OPTION FOR``), leaving the base permission in place.
    cascade: When ``True``, cascades the revocation to principals the
        grantee has granted the permission to (adds ``CASCADE``).

Input parameters:

- `cascade` (boolean)
- `columns`
- `grant_option_only` (boolean)
- `item` (string, required)
- `object_name`
- `permissions` (string, required)
- `principal` (string, required)
- `schema`
- `scope` (string)
- `workspace` (string, required)

### `list_security_policies` (~74 tokens)

List row-level security policies from sys.security_policies.

Returns all security policies and their predicates for the target
Data Warehouse or SQL Analytics Endpoint.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.

Input parameters:

- `item` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `create_security_policy` (~240 tokens)

Create a row-level security policy.

Executes ``CREATE SECURITY POLICY`` with one or more FILTER
predicates. There is no predicate-type option (#966): Fabric Data
Warehouse supports FILTER predicates only. Each entry in *predicates*
must include:

\- ``fn_schema``: schema of the predicate function
\- ``fn_name``: name of the predicate function
\- ``fn_args``: list of column names to pass to the function
\- ``table_schema``: schema of the target table
\- ``table_name``: name of the target table

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    policy_name: Qualified policy name (``"schema.name"`` or ``"name"``).
    predicates: List of predicate definitions (see above).
    state: Initial policy state -- ``True`` to enable, ``False`` to disable
        (default: ``True``).

Input parameters:

- `item` (string, required)
- `policy_name` (string, required)
- `predicates` (array, required)
- `state` (boolean)
- `workspace` (string, required)

### `add_security_predicate` (~229 tokens)

Add a FILTER predicate to an existing row-level security policy.

Executes ``ALTER SECURITY POLICY ... ADD FILTER PREDICATE``. There is
no predicate-type or operation parameter (#966): Fabric Data
Warehouse supports FILTER predicates only.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    policy_name: Qualified policy name (``"schema.name"`` or ``"name"``).
    fn_name: Name of the predicate function.
    fn_args: Column names to pass to the predicate function.
    table_schema: Schema name of the target table.
    table_name: Name of the target table.
    fn_schema: Schema name of the predicate function (optional -- omit
        when the function lives in the default schema).

Input parameters:

- `fn_args` (array, required)
- `fn_name` (string, required)
- `fn_schema`
- `item` (string, required)
- `policy_name` (string, required)
- `table_name` (string, required)
- `table_schema` (string, required)
- `workspace` (string, required)

### `drop_security_predicate` (~176 tokens)

Drop the FILTER predicate from an existing row-level security policy.

Executes ``ALTER SECURITY POLICY ... DROP FILTER PREDICATE ON``. The
T-SQL ``DROP PREDICATE ON`` syntax takes no operation qualifier.
There is no predicate-type parameter (#966): Fabric Data Warehouse
supports FILTER predicates only.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    policy_name: Qualified policy name (``"schema.name"`` or ``"name"``).
    table_schema: Schema name of the target table.
    table_name: Name of the target table.

Input parameters:

- `item` (string, required)
- `policy_name` (string, required)
- `table_name` (string, required)
- `table_schema` (string, required)
- `workspace` (string, required)

### `set_security_policy_state` (~136 tokens)

Enable or disable a row-level security policy.

Executes ``ALTER SECURITY POLICY ... WITH (STATE = ON|OFF)``.
Not destructive -- enabling or disabling a policy is reversible.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    policy_name: Qualified policy name (``"schema.name"`` or ``"name"``).
    enabled: ``True`` to enable the policy, ``False`` to disable it.

Input parameters:

- `enabled` (boolean, required)
- `item` (string, required)
- `policy_name` (string, required)
- `workspace` (string, required)

### `drop_security_policy` (~119 tokens)

Drop a row-level security policy.

Executes ``DROP SECURITY POLICY``.  This is a permanently destructive
operation -- the policy and all its predicates are removed.
Requires ``FABRIC_MCP_ALLOW_DESTRUCTIVE=1``.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    policy_name: Qualified policy name (``"schema.name"`` or ``"name"``).

Input parameters:

- `item` (string, required)
- `policy_name` (string, required)
- `workspace` (string, required)

### `list_masked_columns` (~148 tokens)

List columns with dynamic data masking from sys.masked_columns.

Returns all masked columns on the target Data Warehouse or SQL Analytics
Endpoint.  Filter by *table_schema* and/or *table_name* to narrow results.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    table_schema: Optional schema filter (case-insensitive). Pass ``None``
        to include all schemas.
    table_name: Optional table name filter (case-insensitive). Pass ``None``
        to include all tables.

Input parameters:

- `item` (string, required)
- `table_name`
- `table_schema`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `set_column_mask` (~508 tokens)

Apply or replace a dynamic data mask on a column.

Executes ``ALTER TABLE ... ALTER COLUMN ... ADD MASKED WITH (FUNCTION = '...')``.
\``ADD MASKED`` replaces any existing mask on the column without error.

Blocked by ``FABRIC_MCP_READONLY``.

Supported mask function types:

\- ``"default"`` -- full masking; no extra args.
\- ``"email"`` -- email masking (exposes first char and ``".com"`` suffix); no extra args.
\- ``"random"`` -- numeric random mask; requires *start* and *end*.
\- ``"partial"`` -- custom string partial mask; requires *prefix*, *padding*, and *suffix*.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    table_schema: Schema name of the target table.
    table_name: Name of the target table.
    column_name: Name of the column to mask.
    fn_type: Mask function type -- ``"default"``, ``"email"``, ``"random"``,
        or ``"partial"`` (case-insensitive).
    start: Lower bound for ``random()`` masking (required when *fn_type* is
        ``"random"``). Must be <= *end*.
    end: Upper bound for ``random()`` masking (required when *fn_type* is
        ``"random"``).
    prefix: Leading characters to expose for ``partial()`` masking (required
        when *fn_type* is ``"partial"``).
    padding: Replacement padding string for ``partial()`` masking (required
        when *fn_type* is ``"partial"``). Must not contain ``"``, ``)``,
        ``;``, ``--``, control characters (including U+0085, U+2028,
        U+2029), and must not exceed 128 characters.
    suffix: Trailing characters to expose for ``partial()`` masking (required
        when *fn_type* is ``"partial"``).

Input parameters:

- `column_name` (string, required)
- `end`
- `fn_type` (string, required)
- `item` (string, required)
- `padding`
- `prefix`
- `start`
- `suffix`
- `table_name` (string, required)
- `table_schema` (string, required)
- `workspace` (string, required)

### `drop_column_mask` (~167 tokens)

Remove a dynamic data mask from a column.

Executes ``ALTER TABLE ... ALTER COLUMN ... DROP MASKED``.
This is a permanently destructive operation -- the mask is removed from the
column and unmasked values become visible to all users who query the column.
Requires ``FABRIC_MCP_ALLOW_DESTRUCTIVE=1``.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    table_schema: Schema name of the target table.
    table_name: Name of the target table.
    column_name: Name of the column whose mask to remove.

Input parameters:

- `column_name` (string, required)
- `item` (string, required)
- `table_name` (string, required)
- `table_schema` (string, required)
- `workspace` (string, required)

### `get_audit_settings` (~60 tokens)

Fetch the current SQL audit settings for a warehouse or SQL analytics endpoint.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse or SQL analytics endpoint name or GUID.

Input parameters:

- `warehouse` (string, required)
- `workspace` (string, required)

### `enable_audit` (~147 tokens)

Enable SQL auditing on a warehouse or SQL analytics endpoint.

CAUTION: The pre-flight GET used to round-trip the existing action-group
list is eventually consistent and may lag a recent PATCH by several minutes.
If the action-group list was changed within that window, this call may
silently revert it. Space audit writes at least a few minutes apart.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse or SQL analytics endpoint name or GUID.
    retention_days: Log retention in days (0-3650; 0 = unlimited). Default 0.

Input parameters:

- `retention_days` (integer)
- `warehouse` (string, required)
- `workspace` (string, required)

### `disable_audit` (~110 tokens)

Disable SQL auditing on a warehouse or SQL analytics endpoint.

CAUTION: Each audit write reads current settings via an eventually-consistent
GET that may lag a recent PATCH by several minutes. Two audit writes issued
within that window can cause the second to silently revert the first.
Space audit writes at least a few minutes apart.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse or SQL analytics endpoint name or GUID.

Input parameters:

- `warehouse` (string, required)
- `workspace` (string, required)

### `set_audit_action_groups` (~177 tokens)

Replace the audited action groups for a warehouse or SQL analytics endpoint.

Only replaces the action groups. Does not toggle the audit enabled or
disabled state; if auditing was Disabled before the call it remains Disabled
afterwards.

CAUTION: Each audit write reads current settings via an eventually-consistent
GET that may lag a recent PATCH by several minutes. The retention period
read from that GET is round-tripped; if retention was changed within the lag
window, this call may silently revert it. Space audit writes at least a few
minutes apart.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse or SQL analytics endpoint name or GUID.
    action_groups: List of audit action group names.

Input parameters:

- `action_groups` (array, required)
- `warehouse` (string, required)
- `workspace` (string, required)

### `add_audit_group` (~175 tokens)

Add a single audit action group without overwriting the others.

Idempotent -- if the group is already present the current settings are
returned unchanged.  Auditing must already be enabled.

CAUTION: changes take effect immediately on the live audit policy.

CAUTION: Each audit write reads current settings via an eventually-consistent
GET that may lag a recent PATCH by several minutes. Two audit writes issued
within that window can cause the second to silently revert the first.
Space audit writes at least a few minutes apart.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse or SQL analytics endpoint name or GUID.
    group: Action group name, e.g. ``BATCH_COMPLETED_GROUP``.

Input parameters:

- `group` (string, required)
- `warehouse` (string, required)
- `workspace` (string, required)

### `remove_audit_group` (~176 tokens)

Remove a single audit action group without overwriting the others.

Idempotent -- if the group is not present the current settings are returned
unchanged.  Auditing must already be enabled.

CAUTION: changes take effect immediately on the live audit policy.

CAUTION: Each audit write reads current settings via an eventually-consistent
GET that may lag a recent PATCH by several minutes. Two audit writes issued
within that window can cause the second to silently revert the first.
Space audit writes at least a few minutes apart.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse or SQL analytics endpoint name or GUID.
    group: Action group name, e.g. ``BATCH_COMPLETED_GROUP``.

Input parameters:

- `group` (string, required)
- `warehouse` (string, required)
- `workspace` (string, required)

### `set_audit_retention` (~170 tokens)

Update the audit log retention period without changing the audit enabled/disabled state.

Audit must already be enabled; if disabled, enable it first with ``enable_audit``.

CAUTION: The pre-flight GET used to round-trip the existing action-group
list is eventually consistent and may lag a recent PATCH by several minutes.
If the action-group list was changed within that window, this call may
silently revert it. Space audit writes at least a few minutes apart.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse or SQL analytics endpoint name or GUID.
    days: Retention period in days (1-3650). The API enforces its own upper bound.

Input parameters:

- `days` (integer, required)
- `warehouse` (string, required)
- `workspace` (string, required)

### `list_running_queries` (~60 tokens)

Return all currently-executing queries on a warehouse or SQL Analytics Endpoint.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.

Input parameters:

- `item` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `list_connections` (~57 tokens)

Return all active SQL connections on a warehouse or SQL Analytics Endpoint.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.

Input parameters:

- `item` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `kill_session` (~78 tokens)

Terminate a session on a warehouse by session_id.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    session_id: Session ID to terminate (must be a positive integer).

Input parameters:

- `item` (string, required)
- `session_id` (integer, required)
- `workspace` (string, required)

### `list_request_history` (~119 tokens)

Return completed SQL requests from queryinsights.exec_requests_history.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    limit: Maximum rows to return (1-10000, default 100).
    since: Optional ISO-8601 lower bound on submit_time.
    until: Optional ISO-8601 upper bound on submit_time.

Input parameters:

- `item` (string, required)
- `limit` (integer)
- `since`
- `until`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `list_session_history` (~120 tokens)

Return completed sessions from queryinsights.exec_sessions_history.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    limit: Maximum rows to return (1-10000, default 100).
    since: Optional ISO-8601 lower bound on session_start_time.
    until: Optional ISO-8601 upper bound on session_start_time.

Input parameters:

- `item` (string, required)
- `limit` (integer)
- `since`
- `until`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `list_frequent_queries` (~125 tokens)

Return frequently-run queries from queryinsights.frequently_run_queries.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    limit: Maximum rows to return (1-10000, default 100).
    since: Optional ISO-8601 lower bound on last_run_start_time.
    until: Optional ISO-8601 upper bound on last_run_start_time.

Input parameters:

- `item` (string, required)
- `limit` (integer)
- `since`
- `until`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `list_locks` (~174 tokens)

Return active lock rows from sys.dm_tran_locks joined with sys.dm_exec_requests.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    limit: Maximum rows to return (1-10000, default 100).
    waiting_only: When True, restrict to locks with request_status WAIT or CONVERT.
    blocked_only: When True, show only blocked sessions (victims).
        The blocker's session_id appears in blocking_session_id.
    include_database: When True, include DATABASE-scoped lock rows (excluded by default).

Input parameters:

- `blocked_only` (boolean)
- `include_database` (boolean)
- `item` (string, required)
- `limit` (integer)
- `waiting_only` (boolean)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `get_request_detail` (~100 tokens)

Look up a completed query from queryinsights.exec_requests_history.

Uses distributed_statement_id to retrieve full query text and execution
metrics after the query completes.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    dist_statement_id: The GUID identifying the distributed statement to look up.

Input parameters:

- `dist_statement_id` (string, required)
- `item` (string, required)
- `workspace` (string, required)

Output parameters:

- `result`

### `list_long_running_queries` (~124 tokens)

Return long-running queries from queryinsights.long_running_queries.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    limit: Maximum rows to return (1-10000, default 100).
    since: Optional ISO-8601 lower bound on last_run_start_time.
    until: Optional ISO-8601 upper bound on last_run_start_time.

Input parameters:

- `item` (string, required)
- `limit` (integer)
- `since`
- `until`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `execute_sql` (~505 tokens)

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 ``truncate…

Input parameters:

- `item` (string, required)
- `max_rows` (integer)
- `query` (string, required)
- `workspace` (string, required)

### `get_query_plan` (~584 tokens)

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``    → ``{…

Input parameters:

- `format` (string)
- `item` (string, required)
- `query` (string, required)
- `workspace` (string, required)

### `list_snapshots` (~31 tokens)

Return all snapshots belonging to a warehouse.

Input parameters:

- `warehouse` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `create_snapshot` (~113 tokens)

Create a new warehouse snapshot.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse name or GUID.
    name: Display name for the new snapshot.
    description: Optional description.
    snapshot_dt: Optional ISO-8601 datetime string for the snapshot point-in-time.
        Naive datetimes (no timezone offset) are interpreted as UTC.

Input parameters:

- `description`
- `name` (string, required)
- `snapshot_dt`
- `warehouse` (string, required)
- `workspace` (string, required)

### `rename_snapshot` (~40 tokens)

Rename a warehouse snapshot.

Input parameters:

- `description`
- `new_name` (string, required)
- `snapshot` (string, required)
- `workspace` (string, required)

### `delete_snapshot` (~27 tokens)

Delete a warehouse snapshot.

Input parameters:

- `snapshot` (string, required)
- `workspace` (string, required)

### `roll_snapshot_timestamp` (~117 tokens)

Roll a snapshot's timestamp forward (or reset to current).

Args:
    workspace: Workspace name or GUID.
    warehouse: Parent warehouse name or GUID (used for the SQL connection).
    snapshot_name: The snapshot database name to roll.
    new_dt: Optional ISO-8601 datetime string; defaults to CURRENT_TIMESTAMP.
        Naive datetimes (no timezone offset) are interpreted as UTC.

Input parameters:

- `new_dt`
- `snapshot_name` (string, required)
- `warehouse` (string, required)
- `workspace` (string, required)

### `list_restore_points` (~31 tokens)

Return all restore points for a warehouse.

Input parameters:

- `warehouse` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `get_restore_point` (~82 tokens)

Return a single restore point by ID.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse name or GUID.
    restore_point_id: The restore point ID string (e.g. ``"1726617378000"``).

Input parameters:

- `restore_point_id` (string, required)
- `warehouse` (string, required)
- `workspace` (string, required)

### `create_restore_point` (~86 tokens)

Create a restore point for a warehouse at the current timestamp.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse name or GUID.
    name: Optional display name (max 128 chars).
    description: Optional description (max 512 chars).

Input parameters:

- `description`
- `name`
- `warehouse` (string, required)
- `workspace` (string, required)

### `update_restore_point` (~120 tokens)

Rename and/or update the description of a restore point.

At least one of *name* or *description* must be provided.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse name or GUID.
    restore_point_id: The restore point ID string.
    name: New display name (max 128 chars).
    description: New description (max 512 chars).

Input parameters:

- `description`
- `name`
- `restore_point_id` (string, required)
- `warehouse` (string, required)
- `workspace` (string, required)

### `delete_restore_point` (~76 tokens)

Delete a user-defined restore point.

System-created restore points cannot be deleted.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse name or GUID.
    restore_point_id: The restore point ID string.

Input parameters:

- `restore_point_id` (string, required)
- `warehouse` (string, required)
- `workspace` (string, required)

### `restore_warehouse_in_place` (~106 tokens)

Restore a warehouse in-place to a restore point.

WARNING: This is a destructive, long-running operation. The warehouse
will be unavailable for approximately 10 minutes while the restore
completes.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse name or GUID.
    restore_point_id: The restore point ID string to restore to.

Input parameters:

- `restore_point_id` (string, required)
- `warehouse` (string, required)
- `workspace` (string, required)

### `list_views` (~73 tokens)

List SQL views on a warehouse or SQL Analytics Endpoint.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    schema: When provided, only views in this schema are returned.

Input parameters:

- `item` (string, required)
- `schema`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `read_view` (~172 tokens)

Return up to *count* rows from a view as JSON-serialisable columns + rows.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified view name, e.g. ``dbo.vw_sales``.
    count: Maximum number of rows to return (1-10000, default 10).
    as_of: Optional ISO-8601 UTC timestamp for a point-in-time (time-travel)
        read.  When supplied the query uses ``OPTION (FOR TIMESTAMP AS OF ...)``.
        Omit to read the latest data.

Input parameters:

- `as_of`
- `count` (integer)
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `count_view_rows` (~156 tokens)

Return the total row count of a view via ``SELECT COUNT_BIG(*)``.

Works on both Fabric Data Warehouses and SQL Analytics Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified view name, e.g. ``dbo.vw_sales``.
    as_of: Optional ISO-8601 UTC timestamp for a point-in-time (time-travel)
        count.  When supplied the query uses ``OPTION (FOR TIMESTAMP AS OF ...)``.
        Omit to count the latest data.

Input parameters:

- `as_of`
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `get_view_columns` (~96 tokens)

Return column metadata for a SQL view via ``sys.columns``.

Works on both Fabric Data Warehouses and SQL Analytics Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified view name, e.g. ``dbo.vw_sales``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `get_view` (~81 tokens)

Fetch the full definition of a view (schema.view).

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified view name, e.g. ``dbo.vw_sales``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `create_view` (~254 tokens)

Create a new SQL view.

CAUTION: ``select_body`` is executed verbatim as DDL. Ensure the body
matches the user's intent before calling this tool.

\``select_body`` must be a single read-only SELECT or WITH (CTE)
statement.  The guard is always on and fail-closed: a write keyword
(DELETE, DROP, INSERT, etc.) or a semicolon anywhere in the body is
rejected, even inside a string literal or quoted identifier.  If a
legitimate view body contains a write keyword (e.g. a column alias
'DELETE'), rewrite the expression to avoid the keyword.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified view name, e.g. ``dbo.vw_sales``.
    select_body: Single read-only SELECT or WITH (CTE) statement for the
        view body.  Write keywords and semicolons are rejected
        fail-closed, even inside string literals or quoted identifiers.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `select_body` (string, required)
- `workspace` (string, required)

### `update_view` (~261 tokens)

Redefine a SQL view via CREATE OR ALTER VIEW.

CAUTION: ``select_body`` is executed verbatim as DDL. Ensure the body
matches the user's intent before calling this tool.

\``select_body`` must be a single read-only SELECT or WITH (CTE)
statement.  The guard is always on and fail-closed: a write keyword
(DELETE, DROP, INSERT, etc.) or a semicolon anywhere in the body is
rejected, even inside a string literal or quoted identifier.  If a
legitimate view body contains a write keyword (e.g. a column alias
'DELETE'), rewrite the expression to avoid the keyword.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified view name, e.g. ``dbo.vw_sales``.
    select_body: Single read-only SELECT or WITH (CTE) statement for the
        new view body.  Write keywords and semicolons are rejected
        fail-closed, even inside string literals or quoted identifiers.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `select_body` (string, required)
- `workspace` (string, required)

### `drop_view` (~75 tokens)

Drop a SQL view.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified view name, e.g. ``dbo.vw_sales``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `rename_view` (~149 tokens)

Rename a SQL view via sp_rename.

Works on both Data Warehouses and SQL Analytics Endpoints.

The new name must be a bare (unqualified) identifier — ``sp_rename``
cannot move a view across schemas.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Current dot-separated qualified view name,
        e.g. ``dbo.vw_sales``.
    new_name: New bare view name (no schema prefix), e.g. ``vw_revenue``.

Input parameters:

- `item` (string, required)
- `new_name` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `transfer_view` (~259 tokens)

Move a SQL view to another schema via ``ALTER SCHEMA ... TRANSFER OBJECT::...``.

Works on both Data Warehouses and SQL Analytics Endpoints — no DW-only
guard is applied.

CAUTION: ``ALTER SCHEMA ... TRANSFER`` moves the view but does **not**
rewrite the schema name inside the view's stored definition
(``sys.sql_modules.definition``, ``OBJECT_DEFINITION()``). After a
transfer, the returned (and any subsequent ``get_view``) ``definition``
may still show the *old* schema name in the ``CREATE ... AS`` header,
even though the view now lives in the new schema. This tool does not
rewrite the definition text — doing so would require parsing and
regenerating SQL, which this project deliberately avoids.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Current dot-separated qualified view name,
        e.g. ``dbo.vw_sales``.
    target_schema: Schema to move the view into, e.g. ``archive``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `target_schema` (string, required)
- `workspace` (string, required)

### `list_procedures` (~92 tokens)

List stored procedures on a warehouse or SQL Analytics Endpoint.

Stored procedures are supported on both Fabric Data Warehouses and
SQL Analytics Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    schema: When provided, only procedures in this schema are returned.

Input parameters:

- `item` (string, required)
- `schema`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `get_procedure` (~100 tokens)

Fetch the full definition of a stored procedure (schema.proc).

Stored procedures are supported on both Fabric Data Warehouses and
SQL Analytics Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified procedure name, e.g. ``dbo.usp_load``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `create_procedure` (~141 tokens)

Create a new stored procedure.

Stored procedures are supported on both Fabric Data Warehouses and
SQL Analytics Endpoints.

CAUTION: ``body`` is executed verbatim as DDL. Ensure the body
matches the user's intent before calling this tool.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified procedure name, e.g. ``dbo.usp_load``.
    body: The procedure body (the AS … section).

Input parameters:

- `body` (string, required)
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `update_procedure` (~149 tokens)

Redefine a stored procedure via CREATE OR ALTER PROCEDURE.

Stored procedures are supported on both Fabric Data Warehouses and
SQL Analytics Endpoints.

CAUTION: ``body`` is executed verbatim as DDL. Ensure the body
matches the user's intent before calling this tool.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified procedure name, e.g. ``dbo.usp_load``.
    body: The new procedure body (the AS … section).

Input parameters:

- `body` (string, required)
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `drop_procedure` (~93 tokens)

Drop a stored procedure.

Stored procedures are supported on both Fabric Data Warehouses and
SQL Analytics Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified procedure name, e.g. ``dbo.usp_load``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `transfer_procedure` (~214 tokens)

Move a stored procedure to another schema via ``ALTER SCHEMA ... TRANSFER OBJECT::...``.

Stored procedures are supported on both Fabric Data Warehouses and
SQL Analytics Endpoints; unlike ``transfer_table``, no endpoint guard
is applied here.

CAUTION: ``ALTER SCHEMA ... TRANSFER`` moves the procedure but does
NOT rewrite the schema name inside its stored definition. After a
transfer, ``get_procedure`` may still show the OLD schema name in the
\``CREATE ... AS`` header even though the procedure now lives in the
new schema.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Current dot-separated qualified procedure name,
        e.g. ``dbo.usp_load``.
    target_schema: Schema to move the procedure into, e.g. ``archive``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `target_schema` (string, required)
- `workspace` (string, required)

### `list_functions` (~175 tokens)

List T-SQL user-defined functions on a warehouse or SQL Analytics Endpoint.

Scalar UDFs (FN) and inline TVFs (IF) are preview features on Fabric DW as of
mid-2026.  Function DDL is supported on both Data Warehouses and SQL Analytics
Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    schema: When provided, only functions in this schema are returned.
    kind: Filter by function kind — ``"scalar"`` (FN only),
        ``"inline-tvf"`` (IF only), or ``"all"`` (FN + IF + TF, the default).

Input parameters:

- `item` (string, required)
- `kind` (string)
- `schema`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `get_function` (~133 tokens)

Fetch the full definition of a T-SQL user-defined function (schema.fn).

Returns the function definition (from ``sys.sql_modules``) and its parameter list
(from ``sys.parameters``).  Scalar UDFs and inline TVFs are supported on both
Data Warehouses and SQL Analytics Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    qualified_name: Dot-separated qualified function name, e.g. ``dbo.fn_clean_input``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `create_function` (~200 tokens)

Create a new T-SQL user-defined function.

Scalar UDFs and inline TVFs are preview features on Fabric DW as of mid-2026.
Function DDL is supported on both Data Warehouses and SQL Analytics Endpoints.

CAUTION: ``body`` is executed verbatim as DDL. Ensure the body matches the
user's intent before calling this tool.

The body should include the parameter list, RETURNS clause, and function body
(everything that follows ``CREATE FUNCTION [schema].[name]``).

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    qualified_name: Dot-separated qualified function name, e.g. ``dbo.fn_clean_input``.
    body: The function body (parameter list, RETURNS clause, and implementation).

Input parameters:

- `body` (string, required)
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `update_function` (~208 tokens)

Redefine a T-SQL user-defined function via CREATE OR ALTER FUNCTION.

Note: ALTER FUNCTION cannot change the function kind (e.g. scalar to inline TVF).
The body must be compatible with the original function's kind.

Scalar UDFs and inline TVFs are preview features on Fabric DW as of mid-2026.
Function DDL is supported on both Data Warehouses and SQL Analytics Endpoints.

CAUTION: ``body`` is executed verbatim as DDL. Ensure the body matches the
user's intent before calling this tool.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    qualified_name: Dot-separated qualified function name, e.g. ``dbo.fn_clean_input``.
    body: The new function body (parameter list, RETURNS clause, and implementation).

Input parameters:

- `body` (string, required)
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `transfer_function` (~223 tokens)

Move a T-SQL user-defined function to another schema via ALTER SCHEMA TRANSFER.

Function DDL is supported on both Data Warehouses and SQL Analytics
Endpoints -- unlike table transfer, no endpoint guard applies here.

CAUTION: ``ALTER SCHEMA ... TRANSFER`` does not rewrite the schema name
inside the function's stored definition (``sys.sql_modules.definition``).
After a transfer, ``get_function`` may still show the *old* schema name
in the ``CREATE ... AS`` header, even though the function now lives in
the new schema. This tool does not rewrite the definition text.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    qualified_name: Current dot-separated qualified function name, e.g.
        ``dbo.fn_clean_input``.
    target_schema: Schema to move the function into, e.g. ``archive``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `target_schema` (string, required)
- `workspace` (string, required)

### `drop_function` (~148 tokens)

Drop a T-SQL user-defined function.

Function DDL is supported on both Data Warehouses and SQL Analytics Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    qualified_name: Dot-separated qualified function name, e.g. ``dbo.fn_clean_input``.
    if_exists: When ``true``, a missing function is treated as a no-op and
        ``{"dropped": false}`` is returned instead of raising an error.
        Defaults to ``false``.

Input parameters:

- `if_exists` (boolean)
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `list_schemas` (~123 tokens)

List user-defined SQL schemas on a warehouse or SQL Analytics Endpoint.

System schemas (``sys``, ``INFORMATION_SCHEMA``, ``db_*`` fixed-role
schemas, ``guest``) are excluded.  ``dbo`` is included as it is
user-writable.

Listing schemas is a read-only operation and works on both Fabric Data
Warehouses and SQL Analytics Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.

Input parameters:

- `item` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `create_schema` (~105 tokens)

Create a new SQL schema on a warehouse or SQL Analytics Endpoint.

Both Fabric Data Warehouses and SQL Analytics Endpoints support
\``CREATE SCHEMA`` per the Microsoft Fabric T-SQL reference.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    name: The schema name.  Must be a valid SQL identifier.

Input parameters:

- `item` (string, required)
- `name` (string, required)
- `workspace` (string, required)

### `delete_schema` (~211 tokens)

Drop a SQL schema from a warehouse.

CAUTION: This is a destructive, irreversible operation.  The schema will
be permanently deleted.  If the schema still contains tables or views,
the operation will fail unless *cascade* is ``True``.

CAUTION: When *cascade* is ``True``, **all tables and views in the schema
are permanently deleted along with their data**.  Confirm explicitly with
the user before calling with ``cascade=True``.

Both Fabric Data Warehouses and SQL Analytics Endpoints support
\``DROP SCHEMA`` per the Microsoft Fabric T-SQL reference.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.
    name: The schema name to drop.
    cascade: When ``True``, drop all tables and views in the schema first.
        Defaults to ``False``.

Input parameters:

- `cascade` (boolean)
- `item` (string, required)
- `name` (string, required)
- `workspace` (string, required)

### `list_tables` (~73 tokens)

List SQL tables on a warehouse or SQL Analytics Endpoint.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    schema: When provided, only tables in this schema are returned.

Input parameters:

- `item` (string, required)
- `schema`
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `read_table` (~170 tokens)

Return up to *count* rows from a table as JSON-serialisable columns + rows.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.
    count: Maximum number of rows to return (1-10000, default 10).
    as_of: Optional ISO-8601 UTC timestamp for a point-in-time (time-travel)
        read.  When supplied the query uses ``OPTION (FOR TIMESTAMP AS OF ...)``.
        Omit to read the latest data.

Input parameters:

- `as_of`
- `count` (integer)
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `count_table_rows` (~154 tokens)

Return the total row count of a table via ``SELECT COUNT_BIG(*)``.

Works on both Fabric Data Warehouses and SQL Analytics Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.
    as_of: Optional ISO-8601 UTC timestamp for a point-in-time (time-travel)
        count.  When supplied the query uses ``OPTION (FOR TIMESTAMP AS OF ...)``.
        Omit to count the latest data.

Input parameters:

- `as_of`
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `get_cluster_columns` (~114 tokens)

Return the data-clustering columns of a table, ordered by clustering ordinal.

Only supported on Fabric Data Warehouses.  SQL Analytics Endpoints raise a
\``ToolError``.  Returns an empty list when no clustering columns are defined.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `get_table_columns` (~94 tokens)

Return column metadata for a SQL table via ``sys.columns``.

Works on both Fabric Data Warehouses and SQL Analytics Endpoints.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `create_table` (~386 tokens)

Create a new SQL table via CTAS (CREATE TABLE AS SELECT).

Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).
The service rejects SQL Analytics Endpoints with a ``ToolError``.

CAUTION: ``select_body`` is executed verbatim as DDL on the warehouse.
Ensure the body matches the user's intent before calling this tool.

\``select_body`` must be a single read-only SELECT or WITH (CTE)
statement.  The guard is always on and fail-closed: a write keyword
(DELETE, DROP, INSERT, etc.) or a semicolon anywhere in the body is
rejected, even inside a string literal or quoted identifier.  If a
legitimate query body contains a write keyword (e.g. a column alias
'DELETE'), rewrite the expression to avoid the keyword.

When ``cluster_by`` is supplied, the DDL becomes
\``CREATE TABLE … WITH (CLUSTER BY ([c1], [c2])) AS SELECT …``.
Column existence is not validated for CTAS because the result columns
come from the SELECT and are not known ahead of time.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.
    select_body: Single read-only SELECT or WITH (CTE) statement for the
        CTAS source.  Write keywords and semicolons are rejected
        fail-closed, even inside string literals or quoted identifiers.
    cluster_by: Optional list of column names for the ``CLUSTER BY`` clause
        (up to 4).

Input parameters:

- `cluster_by`
- `item` (string, required)
- `qualified_name` (string, required)
- `select_body` (string, required)
- `workspace` (string, required)

### `delete_table` (~137 tokens)

Drop a SQL table.

Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).
The service rejects SQL Analytics Endpoints with a ``ToolError``.

CAUTION: This is a destructive, irreversible operation.  The table and all
its data will be permanently deleted.  Confirm with the user before calling.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `clear_table` (~151 tokens)

Truncate a SQL table (remove all rows, keep structure).

Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).
The service rejects SQL Analytics Endpoints with a ``ToolError``.

CAUTION: This is a destructive, irreversible operation.  All rows will be
permanently deleted.  The table structure and schema are preserved.
Confirm with the user before calling.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `create_empty_table` (~332 tokens)

Create an empty table from an explicit column spec (DDL only, no data).

Builds ``CREATE TABLE [schema].[table] (col TYPE [NULL|NOT NULL], …)`` from
the supplied column definitions.  No data is read or inserted; this is a
pure DDL operation.

Server-side file access is unreliable in MCP deployments, so CSV/Parquet
inference is not available via this tool — use the ``fabric-dw tables create
\--from-parquet`` or ``--from-csv`` CLI commands instead.

Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).

When ``cluster_by`` is supplied, each column must appear in ``columns``.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.
    columns: List of column definitions, each a dict with:
        ``name`` (str) — column identifier;
        ``sql_type`` (str) — Fabric-DW T-SQL type, e.g. ``"INT"``, ``"VARCHAR(255)"``;
        ``nullable`` (bool, optional, default true) — whether the column allows NULL.
    cluster_by: Optional list of column names for the ``CLUSTER BY`` clause
        (up to 4).  Each name must appear in ``columns``.

Input parameters:

- `cluster_by`
- `columns` (array, required)
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `clone_table` (~200 tokens)

Create a zero-copy clone of a table using ``CREATE TABLE … AS CLONE OF …``.

Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.
    source: Qualified source table name, e.g. ``dbo.sales``.
    new_table: Qualified name for the new cloned table, e.g. ``dbo.sales_clone``.
    at: Optional ISO-8601 UTC timestamp for a point-in-time clone,
        e.g. ``2024-05-20T14:00:00``.  Must be within the data-retention
        window (30 days by default).  When omitted, the clone reflects the
        current state of the source table.

Input parameters:

- `at`
- `item` (string, required)
- `new_table` (string, required)
- `source` (string, required)
- `workspace` (string, required)

### `get_table_health_metrics` (~175 tokens)

Return health metrics for a table via ``sp_get_table_health_metrics``.

Only supported on SQL Analytics Endpoints (not Data Warehouses).  The
proc surfaces Delta/Parquet layout issues such as small files,
fragmentation, excessive deletes/updates, and delayed checkpoints.

The stored procedure is Generally Available (announced at Build 2026)
but its output column schema is not yet documented by Microsoft.
Columns and rows are passed through verbatim.

Args:
    workspace: Workspace name or GUID.
    item: SQL Analytics Endpoint name or GUID.  Data Warehouses are
        rejected with a ``ToolError``.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `rename_table` (~207 tokens)

Rename a SQL table via ``sp_rename`` (Data-Warehouse-only).

Renames the table in-place within the same schema using T-SQL
\``EXEC sp_rename``.  Both the current qualified name and the new bare
name are passed as bound parameters — no SQL injection is possible.

\``sp_rename`` cannot move a table to a different schema, so *new_name*
must be an unqualified (bare) name without a dot.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    qualified_name: Current dot-separated qualified table name, e.g.
        ``dbo.sales``.
    new_name: New table name (unqualified, e.g. ``sales_v2``).  Must not
        contain a dot.

Input parameters:

- `item` (string, required)
- `new_name` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `transfer_table` (~217 tokens)

Move a SQL table to another schema via ``ALTER SCHEMA ... TRANSFER OBJECT::...``.

Data-Warehouse-only: transferring a table between schemas via T-SQL is
not supported on the Fabric SQL Analytics Endpoint and can break the
OneLake sync, so SQL Analytics Endpoints are rejected with a ``ToolError``.

CAUTION: Permissions granted directly on the table are dropped by the
engine when the schema changes. Dependent views and stored procedures
that reference the table by its old schema-qualified name are NOT
automatically updated and may need refreshing after the transfer.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    qualified_name: Current dot-separated qualified table name, e.g.
        ``dbo.sales``.
    target_schema: Schema to move the table into, e.g. ``archive``.

Input parameters:

- `item` (string, required)
- `qualified_name` (string, required)
- `target_schema` (string, required)
- `workspace` (string, required)

### `set_cluster_columns` (~310 tokens)

Change (or remove) the data-clustering columns of an existing table.

Rebuilds the table via a transactional CTAS-swap:

1\. ``CREATE TABLE [schema].[__recluster_<hex>] [WITH (CLUSTER BY (...))]
   AS SELECT * FROM [schema].[orig]``
2\. ``DROP TABLE [schema].[orig]``
3\. ``EXEC sp_rename`` to restore the original name

All three steps run inside ONE transaction.  Any failure rolls back
automatically — no orphan temp table is left behind.

CAUTION: This operation copies the full table (runtime is proportional
to table size).  Dependent views and stored procedures that reference
this table by name are NOT automatically updated by ``sp_rename`` and
may need refreshing after the swap.

Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.
    cluster_by: New list of column names for the ``CLUSTER BY`` clause
        (up to 4).  Pass ``null`` or an empty list to remove clustering
        (rebuilds table without ``CLUSTER BY``).

Input parameters:

- `cluster_by`
- `item` (string, required)
- `qualified_name` (string, required)
- `workspace` (string, required)

### `load_table_from_url` (~579 tokens)

Load data into a Data Warehouse table via ``COPY INTO`` from a remote URL.

Supported file types: ``CSV``, ``PARQUET``.  JSON remote URLs require
downloading and converting locally first; use the CLI ``tables load``
command for local files (including JSON).

For OneLake or same-tenant URLs, no credential is needed.  For secured
external URLs (Azure Blob Storage SAS, etc.), supply ``credential_type``
and the appropriate ``secret``/``identity`` values.

CAUTION: This operation loads data into the target table.  Confirm the
source URL and target table before calling.

Note: ``secret`` / ``identity`` values are accepted but are NEVER logged
or included in any debug output.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.
    url: Source URL (OneLake DFS URL or external Azure Blob URL).
    file_type: ``CSV`` or ``PARQUET``.
    credential_type: Credential type for the source URL.
    secret: Credential secret (not logged).
    identity: Identity for managed-identity or service-principal.
    delimiter: CSV column delimiter.
    has_header: Whether the CSV file has a header row.
    encoding: CSV file encoding.
    field_quote: CSV field-quote character.
    row_terminator: CSV row terminator.
    max_errors: Maximum errors before aborting.
    rejected_row_location: URL for rejected-row output.

Input parameters:

- `credential_type` (string): Credential type for secured external URLs. Use 'none' for OneLake or public URLs.
- `delimiter`: CSV column delimiter (e.g. ',', '\t').
- `encoding`: CSV file encoding (e.g. 'UTF8', 'UTF8BOM').
- `field_quote`: CSV field-quote character.
- `file_type` (string, required): File type to load.  JSON is not supported for remote URLs; download and convert locally first.
- `has_header` (boolean): When True, the first CSV row is a header and is skipped.
- `identity`: Identity value for managed-identity or service-principal credential types.
- `item` (string, required)
- `max_errors`: Maximum number of errors before aborting.
- `qualified_name` (string, required)
- `rejected_row_location`: URL to write rejected rows to.
- `row_terminator`: CSV row terminator (e.g. '\n', '\r\n').
- `secret`: Credential secret (SAS token, client secret, or account key). NEVER log or echo this value.
- `url` (string, required)
- `workspace` (string, required)

### `import_table_from_url` (~903 tokens)

Load data into an existing Data Warehouse table via ``COPY INTO`` from a remote URL.

The target table **must already exist** and have a compatible schema.
For auto-create with schema inference from local files, use the CLI
\``tables load --file --create`` command instead.

\``if_exists`` controls behaviour when the table already exists:

\- ``"fail"`` (default): raise an error if the table already exists, or if it
  does not exist (the table must be created first with create_empty_table or
  create_table).
\- ``"append"``: load rows into the existing table without modification.
  Raises an error if the table does not exist.
\- ``"truncate"``: TRUNCATE the existing table, then load, both inside a
  single transaction so a failed load leaves the existing rows intact
  (atomic replace).  Requires ``FABRIC_MCP_ALLOW_DESTRUCTIVE=1``.  Raises
  an error if the table does **not** exist.
\- ``"replace"``: not supported for remote URLs (schema inference requires
  downloading the file).  Use ``"truncate"`` to keep the current schema,
  or download locally and use the CLI with ``--create --if-exists replace``.

Supported file types: ``CSV``, ``PARQUET``.  JSON remote URLs require
downloading and converting locally first; use the CLI ``tables load``
command for local files (including JSON).

For OneLake or same-tenant URLs, no credential is needed.  For secured
external URLs supply ``credential_type`` and the appropriate
\``secret``/``identity`` values.

CAUTION: ``truncate`` is permanently destructive.
Confirm the source URL and target table before calling.

Note: ``secret`` / ``identity`` values are accepted but are NEVER logged
or included in any debug output.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    qualified_name: Dot-separated qualified table name, e.g. ``dbo.sales``.
    url: Source URL (OneLake DFS URL or external Azure Blob URL).
    file_type: ``CSV`` or ``PARQUET``.
    if_exists: Policy wh…

Input parameters:

- `credential_type` (string): Credential type for secured external URLs. Use 'none' for OneLake or public URLs.
- `delimiter`: CSV column delimiter (e.g. ',', '\t').
- `encoding`: CSV file encoding (e.g. 'UTF8', 'UTF8BOM').
- `field_quote`: CSV field-quote character.
- `file_type` (string, required): File type.  JSON is not supported for remote URLs; download and convert locally first.
- `has_header` (boolean): When True, the first CSV row is a header and is skipped.
- `identity`: Identity value for managed-identity or service-principal credential types.
- `if_exists` (string): What to do when the target table exists or is absent. 'fail': error if the table already exists, or if it does not exist (default). 'append': load into the existing table; error if the table is absen…
- `item` (string, required)
- `max_errors`: Maximum number of errors before aborting.
- `qualified_name` (string, required)
- `rejected_row_location`: URL to write rejected rows to.
- `row_terminator`: CSV row terminator (e.g. '\n', '\r\n').
- `secret`: Credential secret (SAS token, client secret, or account key). NEVER log or echo this value.
- `url` (string, required)
- `workspace` (string, required)

### `list_statistics` (~154 tokens)

List statistics on a warehouse or SQL Analytics Endpoint.

Both Data Warehouses and SQL Analytics Endpoints are supported.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    schema: When provided, only statistics on tables in this schema are returned.
    table: When provided, only statistics on this table (unqualified name) are returned.
    user_only: When True, only user-created statistics are returned.
    auto_only: When True, only auto-created statistics are returned.

Input parameters:

- `auto_only` (boolean)
- `item` (string, required)
- `schema`
- `table`
- `user_only` (boolean)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `show_statistics` (~144 tokens)

Show details of a statistic using DBCC SHOW_STATISTICS.

Returns the stat header, density vector, and histogram steps.
Both Data Warehouses and SQL Analytics Endpoints are supported.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL endpoint name or GUID.
    qualified_table: Qualified table name, e.g. ``dbo.sales``.
    stat_name: The name of the statistic to show.
    histogram_only: When True, return only the histogram steps.

Input parameters:

- `histogram_only` (boolean)
- `item` (string, required)
- `qualified_table` (string, required)
- `stat_name` (string, required)
- `workspace` (string, required)

### `create_statistics` (~205 tokens)

Create a single-column statistic on a table.

Only supported on Data Warehouses (SQL Analytics Endpoints are read-only).
Only single-column statistics are supported (Fabric limitation).

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID. SQL Analytics Endpoints are rejected.
    qualified_table: Qualified table name, e.g. ``dbo.sales``.
    column: Column name to build the statistic on.
    stat_name: Name for the new statistic.
    fullscan: When True (default), use WITH FULLSCAN.
        Ignored when sample_percent is provided.
    sample_percent: Sample percentage (1-100). When provided, overrides fullscan
        and uses WITH SAMPLE n PERCENT.

Input parameters:

- `column` (string, required)
- `fullscan` (boolean)
- `item` (string, required)
- `qualified_table` (string, required)
- `sample_percent`
- `stat_name` (string, required)
- `workspace` (string, required)

### `update_statistics` (~178 tokens)

Update an existing statistic via UPDATE STATISTICS.

Only supported on Data Warehouses (SQL Analytics Endpoints are read-only).

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID. SQL Analytics Endpoints are rejected.
    qualified_table: Qualified table name, e.g. ``dbo.sales``.
    stat_name: Name of the statistic to update.
    fullscan: When True (default), use WITH FULLSCAN.
        Ignored when sample_percent is provided.
    sample_percent: Sample percentage (1-100). When provided, overrides fullscan
        and uses WITH SAMPLE n PERCENT.

Input parameters:

- `fullscan` (boolean)
- `item` (string, required)
- `qualified_table` (string, required)
- `sample_percent`
- `stat_name` (string, required)
- `workspace` (string, required)

### `delete_statistics` (~124 tokens)

Drop a statistic via DROP STATISTICS.

CAUTION: This is a destructive, irreversible operation.
Only supported on Data Warehouses (SQL Analytics Endpoints are read-only).

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID. SQL Analytics Endpoints are rejected.
    qualified_table: Qualified table name, e.g. ``dbo.sales``.
    stat_name: Name of the statistic to drop.

Input parameters:

- `item` (string, required)
- `qualified_table` (string, required)
- `stat_name` (string, required)
- `workspace` (string, required)

### `get_warehouse_settings` (~113 tokens)

Return the current server-side database settings for a warehouse.

Reads ``result_set_caching``, ``time_travel_retention_days``,
\``time_travel_retention_cutoff_date``, and ``data_lake_log_publishing``
from ``sys.databases``.

Both Data Warehouses and SQL Analytics Endpoints are supported.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse or SQL Analytics Endpoint name or GUID.

Input parameters:

- `item` (string, required)
- `workspace` (string, required)

### `set_result_set_caching` (~143 tokens)

Enable or disable result-set caching on a warehouse.

Executes ``ALTER DATABASE CURRENT SET RESULT_SET_CACHING { ON | OFF }``
and returns the effective settings read back after the change.

Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).
SQL Analytics Endpoints are rejected with a ``ToolError``.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    enabled: ``True`` to enable result-set caching, ``False`` to disable it.

Input parameters:

- `enabled` (boolean, required)
- `item` (string, required)
- `workspace` (string, required)

### `set_time_travel_retention` (~148 tokens)

Set the time-travel retention period on a warehouse.

Executes ``ALTER DATABASE CURRENT SET TIME_TRAVEL_RETENTION_PERIOD = <n> DAYS``
and returns the effective settings read back after the change.

Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).
SQL Analytics Endpoints are rejected with a ``ToolError``.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    days: Retention period in days. Must be in the range 1-120 (inclusive).

Input parameters:

- `days` (integer, required)
- `item` (string, required)
- `workspace` (string, required)

### `set_data_lake_log_publishing` (~163 tokens)

Enable or disable Delta Lake log publishing on a warehouse.

Executes ``ALTER DATABASE CURRENT SET DATA_LAKE_LOG_PUBLISHING = { AUTO | PAUSED }``
and returns the effective settings read back after the change.

Only supported on Fabric Data Warehouses (not SQL Analytics Endpoints).
SQL Analytics Endpoints are rejected with a ``ToolError``.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.  SQL Analytics Endpoints are rejected.
    enabled: ``True`` to enable Delta Lake log publishing (``= AUTO``),
        ``False`` to disable it (``= PAUSED``).

Input parameters:

- `enabled` (boolean, required)
- `item` (string, required)
- `workspace` (string, required)

### `get_sql_pools_status` (~100 tokens)

Return whether custom SQL Pools are enabled for a workspace.

Returns only the workspace-level enabled/disabled switch
(``customSQLPoolsEnabled``).  Use ``list_sql_pools`` to see the pool
list, or ``get_sql_pool`` for a single pool's details.

Requires workspace admin role.  This tool targets a **beta / preview** API
endpoint that may change before general availability.

Input parameters:

- `workspace` (string, required)

### `list_sql_pools` (~45 tokens)

Return the list of custom SQL pools for a workspace.

Requires workspace admin role.  This tool targets a **beta / preview** API.

Input parameters:

- `workspace` (string, required)

Output parameters:

- `result` (array)

### `get_sql_pool` (~69 tokens)

Return details for a single SQL pool by name.

Args:
    workspace: Workspace name or GUID.
    pool_name: The pool name.

Requires workspace admin role.  This tool targets a **beta / preview** API.

Input parameters:

- `pool_name` (string, required)
- `workspace` (string, required)

### `create_sql_pool` (~184 tokens)

Add a new custom SQL pool to a workspace.

Args:
    workspace: Workspace name or GUID.
    name: Pool name (must be unique within the workspace).
    max_percent: Max resource percentage (1-100).
    is_default: Whether this pool is the default pool. Defaults to false.
    optimize_for_reads: Enable read optimisation. Defaults to true.
    classifier_type: Classifier type (e.g. ``"Application Name"``).
    classifier_values: List of classifier values (e.g. application names).

Requires workspace admin role.  This tool targets a **beta / preview** API.

Input parameters:

- `classifier_type`
- `classifier_values`
- `is_default` (boolean)
- `max_percent` (integer, required)
- `name` (string, required)
- `optimize_for_reads` (boolean)
- `workspace` (string, required)

### `update_sql_pool` (~188 tokens)

Update an existing SQL pool.  Only the parameters you supply are changed.

Args:
    workspace: Workspace name or GUID.
    name: Name of the pool to update.
    max_percent: New max resource percentage (1-100), or omit to keep current.
    is_default: Set or clear the default flag, or omit to keep current.
    optimize_for_reads: Enable/disable read optimisation, or omit to keep current.
    classifier_type: New classifier type, or omit to keep current.
    classifier_values: New classifier value list, or omit to keep current.

Requires workspace admin role.  This tool targets a **beta / preview** API.

Input parameters:

- `classifier_type`
- `classifier_values`
- `is_default`
- `max_percent`
- `name` (string, required)
- `optimize_for_reads`
- `workspace` (string, required)

### `delete_sql_pool` (~70 tokens)

Delete an SQL pool from a workspace.

Args:
    workspace: Workspace name or GUID.
    pool_name: Name of the pool to delete.

Requires workspace admin role.  This tool targets a **beta / preview** API.

Input parameters:

- `pool_name` (string, required)
- `workspace` (string, required)

### `enable_sql_pools` (~46 tokens)

Enable custom SQL Pools for a workspace without modifying pool definitions.

Requires workspace admin role.  This tool targets a **beta / preview** API.

Input parameters:

- `workspace` (string, required)

### `disable_sql_pools` (~60 tokens)

Disable custom SQL Pools for a workspace, preserving pool configuration.

Re-enabling with enable_sql_pools restores the previously saved configuration.

Requires workspace admin role.  This tool targets a **beta / preview** API.

Input parameters:

- `workspace` (string, required)

### `list_sql_pool_insights` (~121 tokens)

Return SQL pool insight events from queryinsights.sql_pool_insights.

Args:
    workspace: Workspace name or GUID.
    warehouse: Warehouse or SQL Analytics Endpoint name or GUID.
    limit: Maximum rows to return (1-10000, default 100).
    since: Optional ISO-8601 lower bound on timestamp.
    until: Optional ISO-8601 upper bound on timestamp.

Input parameters:

- `limit` (integer)
- `since`
- `until`
- `warehouse` (string, required)
- `workspace` (string, required)

Output parameters:

- `result` (array)

### `clear_cache` (~138 tokens)

Erase cached workspace and item name-to-UUID mappings.

Args:
    scope: Which portion of the cache to clear.

        - ``"workspaces"`` — clear only workspace name→UUID entries.
        - ``"items"`` — clear only item (warehouse/endpoint) entries.
        - ``"all"`` (default) — clear all entries.

Returns:
    A dict with keys ``scope`` (the value used), ``workspaces_cleared``
    (number of workspace entries removed), and ``items_cleared`` (number
    of item workspace buckets removed).

Input parameters:

- `scope` (string)

### `generate_dbt_profile` (~425 tokens)

Generate dbt-fabric project file contents for a Fabric Data Warehouse.

Returns the generated file contents as text strings.  Because the MCP server
cannot write to the caller's local filesystem, it is the caller's responsibility
to write the returned strings to the appropriate files.

Authentication note: dbt-fabric is Entra-only.  ServicePrincipal mode emits
\``{{ env_var(...) }}`` placeholders for tenant_id / client_id / client_secret
— no literal secrets are included in the output.

Args:
    workspace: Workspace name or GUID.
    item: Warehouse name or GUID.
    project_name: dbt project name (default: sanitized warehouse name).
    profile_name: dbt profile name (default: same as project_name).
    schema: Default schema (default: ``dbo``).
    target: dbt output target name (default: ``dev``).
    threads: Number of dbt threads (default: 4).
    authentication: dbt-fabric authentication string —
        ``auto`` (DefaultAzureCredential), ``CLI`` (interactive),
        or ``ServicePrincipal``.  Defaults to the server's auth mode.
    with_sources: When ``True``, generate a ``_sources.yml`` from the
        warehouse's actual schemas and tables.

Returns:
    A dict with keys:
    - ``profiles_yml``: content for ``profiles.yml``.
    - ``dbt_project_yml``: content for ``dbt_project.yml``.
    - ``sources_yml``: content for ``models/staging/_sources.yml``.
    - ``requirements_txt``: content for ``requirements.txt``.
    - ``gitignore``: content for ``.gitignore``.

Input parameters:

- `authentication` (string)
- `item` (string, required)
- `profile_name` (string)
- `project_name` (string)
- `schema` (string)
- `target` (string)
- `threads` (integer)
- `with_sources` (boolean)
- `workspace` (string, required)

## Diagnostics

Captured diagnostic sections: Provenance. The full working is on the page: https://verifymcp.io/servers/sdebruyn-fabric-dw-mcp/ghcr-io-sdebruyn-fabric-dw-2026-7-3#diagnostics

## Score history

- 2026-08-03: 37
- 2026-08-02: 37
- 2026-08-01: 34
- 2026-07-31: 34
- 2026-07-30: 37
- 2026-07-29: 37
- 2026-07-28: 37
- 2026-07-27: 37
- 2026-07-26: 11

## Links

- Repository: https://github.com/sdebruyn/fabric-dw-mcp-cli
- Website: https://fdw.debruyn.dev/
- Changelog RSS feed: https://verifymcp.io/servers/sdebruyn-fabric-dw-mcp/ghcr-io-sdebruyn-fabric-dw-2026-7-3/changelog.xml
- Changelog JSON feed: https://verifymcp.io/servers/sdebruyn-fabric-dw-mcp/ghcr-io-sdebruyn-fabric-dw-2026-7-3/changelog.json
- HTML version of this page: https://verifymcp.io/servers/sdebruyn-fabric-dw-mcp/ghcr-io-sdebruyn-fabric-dw-2026-7-3
