Skip to main content
Glama

setup_rls_and_roles

Configure Row-Level Security roles and DAX filter expressions in TMDL models, validate security rules against sample queries, and roll back changes if tests fail.

Instructions

Configure Row-Level Security (RLS) roles and validation rules in a TMDL model.

Use this tool when the user asks to:

  • Set up, add, or configure RLS roles and DAX table filter expressions.

  • Test and validate security rules against sample queries (optional live dataset).

Args: target: Target PBIP directory or TMDL path. spec_yaml: YAML specification of security roles, members, and DAX filters. spec_json: JSON specification (either as a string or a structured object/dict). dry_run: If True, validate role specification without writing to disk. rollback_on_test_failure: Whether to revert modifications if test queries fail. workspace_id: Optional Power BI workspace ID for live RLS EffectiveIdentity checks. dataset_id: Optional Power BI dataset ID for live RLS checks. auth_mode: Optional auth mode ("interactive", "service_principal", "managed_identity"). tenant_id: Optional Azure AD tenant ID. client_id: Optional Azure AD client ID. fabric_client: Optional injected FabricClient (for testing).

Returns: Dict with roles created, test query outcomes, and rollback status if applicable.

Tool call template

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

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

Input Schema

NameRequiredDescriptionDefault
targetYes
dry_runNo
auth_modeNo
client_idNo
spec_jsonNo
spec_yamlNo
tenant_idNo
dataset_idNo
workspace_idNo
fabric_clientNo
rollback_on_test_failureNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.25.1
    • addedInput schema / properties / auth_mode
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Auth Mode"
      +}
    • addedInput schema / properties / client_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Client Id"
      +}
    • addedInput schema / properties / dataset_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Dataset Id"
      +}
    • addedInput schema / properties / fabric_client
      Added value: +{
      +  "default": null,
      +  "title": "Fabric Client"
      +}
    • addedInput schema / properties / tenant_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Tenant Id"
      +}
    • addedInput schema / properties / workspace_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Workspace Id"
      +}
  2. Changed1 schema field changedv1.11.0
    • removedInput schema / properties / spec_json / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
  3. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description bears the full behavioral burden. It does good work explaining dry_run ('validate role specification without writing to disk'), rollback_on_test_failure, and that live validation needs workspace/dataset IDs plus auth. However, it never says whether existing roles are replaced or merged, what permissions are required to write TMDL, or how risky a non-dry-run call is — critical for a mutation tool with zero annotation coverage.

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 definition is front-loaded with purpose, then usage triggers, then a structured Args list — an agent can scan it quickly despite the length. The length is justified by 11 parameters. Minor waste: the 'Returns' block is partly redundant given an output schema exists.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter mutation tool with no annotations, the definition covers intent, triggers, every parameter, and the return shape (roles created, test outcomes, rollback status), so an agent could call it correctly. The remaining gap is operational safety: no statement of prerequisites, permissions, or whether pre-existing RLS roles survive the call.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate, and it largely does: all 11 parameters get a line, and several add real meaning beyond the schema (spec_yaml is the YAML spec of roles/members/DAX filters; spec_json may be a string or structured object; workspace_id/dataset_id exist specifically for live EffectiveIdentity checks; fabric_client is for test injection). It loses points because it does not state the dry_run and rollback_on_test_failure defaults that the schema declares, and target's expected layout is described only loosely.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Configure Row-Level Security (RLS) roles and validation rules in a TMDL model.' That is unambiguous about the operation and the artifact it mutates. It falls short of a 5 only because it doesn't explicitly frame itself against related model-editing work, though no sibling appears to overlap with RLS configuration.

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

Usage Guidelines4/5

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

An explicit 'Use this tool when the user asks to:' block lists two concrete triggers: setting up RLS roles/DAX filters and testing/validating security rules. This gives clear positive guidance. There is no when-not guidance (e.g., don't use this to merely inspect existing roles) and no named alternatives, which keeps it below a 5.

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