Skip to main content
Glama

set_sensitivity_labels

Apply Microsoft Purview sensitivity labels to Power BI reports, semantic models, and dashboards to classify and protect items by label ID and name.

Instructions

Apply Microsoft Purview information protection sensitivity labels to items.

Use this tool when the user asks to:

  • Classify or protect Power BI items (reports, semantic models, dashboards).

  • Set Purview sensitivity labels (Confidential, General, Highly Confidential).

Args: items: List of dicts specifying item IDs and types (e.g. [{"id": "...", "type": "Report"}]). label_id: Microsoft Purview label GUID. label_name: Display name of the sensitivity label. admin_scopes: Optional list of administrative authorization scopes. redact_names: Whether to redact item names in returned logs for security. auth_mode: Optional auth mode ("interactive", "service_principal", "managed_identity"). tenant_id: Optional Azure AD tenant ID. client_id: Optional Azure AD client ID. dry_run: If True, validate permissions without applying labels. fabric_admin_client: Optional injected admin bridge/client (for testing).

Returns: Dict with updated items, failed items, and compliance status.

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": {
      "items": "<items>",
      "label_id": "<label_id>",
      "label_name": "<label_name>"
    },
    "name": "set_sensitivity_labels"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYes
dry_runNo
label_idYes
auth_modeNo
client_idNo
tenant_idNo
label_nameYes
admin_scopesNo
redact_namesNo
fabric_admin_clientNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 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 / fabric_admin_client
      Added value: +{
      +  "default": null,
      +  "title": "Fabric Admin Client"
      +}
    • addedInput schema / properties / tenant_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Tenant Id"
      +}
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it discloses that dry_run validates permissions without applying labels, that redact_names redacts item names in returned logs, that auth_mode supports interactive/service_principal/managed_identity, and that failures are reported per item. Gaps remain for a compliance mutation: it never states the required administrator role/label-policy permissions, whether labels replace or merge with existing ones, or whether the change is reversible.

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?

Purpose and trigger conditions are front-loaded, followed by compact Args and Returns blocks, so an agent can scan it quickly. The Args list largely mirrors schema titles but adds real semantics for each, so most lines earn their place; only the 'for testing' fabric_admin_client entry feels incidental.

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

Completeness3/5

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

For a 10-parameter, mutating compliance operation with no annotations, the definition covers parameters and return structure adequately, and an output schema exists so return detail is not strictly needed. What is missing is operational context an agent would need to call it safely: required admin permissions, idempotency, and the effect on items that already carry a label.

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 does: all ten parameters are explained, including an example shape for items, the GUID nature of label_id, the display-name role of label_name, and the three concrete auth_mode values that are absent from the schema. It omits the accepted item 'type' vocabulary and does not repeat the schema's dry_run default of true.

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 first line states a specific verb and resource: apply Microsoft Purview sensitivity labels to items, further scoped to Power BI reports, semantic models and dashboards. No sibling tool in the listed set performs labeling, so the operation is unambiguous. It stops short of an explicit contrast with any sibling, which is why it is a 4 rather than a 5.

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?

The 'Use this tool when the user asks to' block gives concrete trigger conditions (classify/protect Power BI items, set Confidential/General/Highly Confidential labels). It does not say when NOT to use it or name an alternative path (e.g. reading labels vs. setting them), so there is no exclusion guidance.

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