Skip to main content
Glama

Compare an existing Power BI semantic model with the plan

compare_semantic_model
Read-only

Compares an existing Power BI semantic model with the plan: missing, contradicted and extra relationships, cardinality, direction, active, stale columns, suggested measures. Requires workspace, source and model (SemanticModel.ReadWrite.All or Item.ReadWrite.All) or tmdl (no permission). Returns JSON with the differences and confirmed entries for extra links. Changes nothing. Errors: {error, kind, hint}.

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": {
      "workspace": "<workspace>",
      "source": "<source>"
    },
    "name": "compare_semantic_model"
  }
}

Input Schema

NameRequiredDescriptionDefault
keysNoPrimary keys replacing the inferred ones. Default: inferred. Example: {"order_items": ["order_id", "line_no"]}.
tmdlNo{path: text} of the model's TMDL files (as in a PBIP folder or Git), read instead of fetching the model. Default: none. Example: {"definition/relationships.tmdl": "relationship …"}.
modelNoExisting semantic model in the workspace, by name or id. Default "" (only with tmdl). Example: "Sales model".
schemaNoSchema in the source. Default "dbo".dbo
sourceYesLakehouse, warehouse or SQL database, name or id.
confirmedNoRelationships the user confirmed, added to the plan. Default none. Example: [{"source": "orders", "source_cols": ["ship_to_id"], "target": "addresses", "target_cols": ["address_id"]}].
max_itemsNoCap on counting queries (one per key and relationship), 1–200. Default 60.
workspaceYesFabric workspace, name or id.
check_dataNotrue counts the plan's keys and relationships and the model's extra links against the rows; false (default) compares metadata only. Example: true.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • addedInput schema / properties / check_data / description
      Added value: +"true counts the plan's keys and relationships and the model's extra links against the rows; false (default) compares metadata only. Example: true."
    • addedInput schema / properties / confirmed / description
      Added value: +"Relationships the user confirmed, added to the plan. Default none. Example: [{\"source\": \"orders\", \"source_cols\": [\"ship_to_id\"], \"target\": \"addresses\", \"target_cols\": [\"address_id\"]}]."
    • addedInput schema / properties / keys / description
      Added value: +"Primary keys replacing the inferred ones. Default: inferred. Example: {\"order_items\": [\"order_id\", \"line_no\"]}."
    • addedInput schema / properties / max_items / description
      Added value: +"Cap on counting queries (one per key and relationship), 1–200. Default 60."
    • addedInput schema / properties / model / description
      Added value: +"Existing semantic model in the workspace, by name or id. Default \"\" (only with tmdl). Example: \"Sales model\"."
    • addedInput schema / properties / schema / description
      Added value: +"Schema in the source. Default \"dbo\"."
    • addedInput schema / properties / source / description
      Added value: +"Lakehouse, warehouse or SQL database, name or id."
    • addedInput schema / properties / tmdl / description
      Added value: +"{path: text} of the model's TMDL files (as in a PBIP folder or Git), read instead of fetching the model. Default: none. Example: {\"definition/relationships.tmdl\": \"relationship …\"}."
    • addedInput schema / properties / workspace / description
      Added value: +"Fabric workspace, name or id."
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/openWorld/non-destructive, and the description reinforces this with "Changes nothing" plus useful extras not in the annotations: the required permission scopes, the permission-free tmdl path, the JSON return shape (differences plus confirmed entries for extra links), and the {error, kind, hint} error contract. No contradiction with readOnlyHint – the write scope is an API requirement, not a mutation by the tool.

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?

Front-loaded with purpose in the first clause, then inputs/permissions, then return shape and errors – a sensible order with almost no filler. The line-broken run-on enumeration of compared aspects is dense but each item is informative.

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?

With annotations covering safety, a 100%-documented schema, and an output schema, the description supplies the remaining essentials (permission paths, error shape, no-side-effect guarantee). Minor gap: it never says where "the plan" comes from or what makes it valid, so an agent must infer that from sibling tools.

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 coverage is 100%, so baseline is 3; the description adds an actual clarification by stating model is required unless tmdl is supplied, resolving the schema's ambiguous look (model is optional with default ""). It also explains that max_items caps counting queries, though the schema already carries that.

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 (compare an existing Power BI semantic model against the plan) and enumerates exactly what is compared: missing/contradicted/extra relationships, cardinality, direction, active, stale columns, suggested measures. An agent can tell this apart from validate_plan or review_plan without opening the schema.

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?

Makes the two invocation modes explicit: workspace + source + model (with SemanticModel.ReadWrite.All or Item.ReadWrite.All) OR a tmdl payload with no permission. That is real routing guidance. It stops short of saying when to prefer this over validate_plan/review_plan or what state the plan must be in beforehand.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.