Skip to main content
Glama

pbi_find_unused_fields

Read-onlyIdempotent

Audits a semantic model for unused columns and DAX measures across model logic and scanned bound report layouts; warns if no layouts were scanned before cleanup review.

Instructions

Audits one semantic model for columns and DAX measures not referenced inside the model (DAX, relationships, SortBy, Field Parameters, Hierarchies, RLS/OLS, Incremental Refresh, Derived M) or in scanned bound report layouts. Enforces the has_parsed_layouts safety guard: returns empty lists with a prominent warning if no bound report layouts were scanned. Use to review unused bloat before cleanup. Do NOT use to emit executable Tabular Editor code directly (use pbi_generate_cleanup_script after reviewing results).

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": {
      "model": "<model>"
    },
    "name": "pbi_find_unused_fields"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesSemantic model name or dataset GUID.
tableNoOptional table name filter.
workspaceNoOptional workspace name filter to disambiguate identically named models.
field_typeNoWhich unused objects to return: 'all' (default), 'columns', or 'measures'.all
include_hiddenNoInclude already hidden unused columns/measures (default: true).
include_calculatedNoInclude unused calculated columns (default: true).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.2.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover safety (readOnlyHint, idempotentHint, destructiveHint=false, openWorldHint=false), and the description adds substantive behavior beyond them: the has_parsed_layouts guard that yields empty lists plus a warning when no bound report layouts were scanned. That discloses a false-negative condition the agent must interpret, which is exactly the kind of context annotations cannot express.

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?

Three sentences, front-loaded with purpose, then the safety guard, then usage routing. The long parenthetical reference enumeration is dense but each item genuinely defines what counts as 'referenced', so it earns its space; minor cost is that it delays the guard statement.

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 a read-only audit tool with a fully documented schema and no output schema, the description covers scope, safety caveat, and next step. It implies list-shaped results ('returns empty lists') but does not describe the fields per returned item (e.g., whether reason/lineage is included), which an agent might need to act on results.

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

Parameters3/5

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

Schema description coverage is 100%, including the field_type enum and defaults, so the schema carries all parameter meaning. The description adds no parameter-level detail (no mention of table/workspace disambiguation, hidden or calculated column toggles), so baseline 3 applies.

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

Purpose5/5

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

States a specific verb and resource: 'Audits one semantic model for columns and DAX measures not referenced inside the model'. It also enumerates the reference contexts (DAX, relationships, SortBy, Field Parameters, Hierarchies, RLS/OLS, Incremental Refresh, Derived M) and report layouts, so the scope of 'unused' is unambiguous and clearly distinct from pbi_generate_cleanup_script.

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

Usage Guidelines5/5

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

Explicit when-to-use ('Use to review unused bloat before cleanup') and explicit when-not ('Do NOT use to emit executable Tabular Editor code directly') with the named alternative and sequencing ('use pbi_generate_cleanup_script after reviewing results'). An agent can route correctly without inference.

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