Compare an existing Power BI semantic model with the plan
compare_semantic_modelCompares 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
| Name | Required | Description | Default |
|---|---|---|---|
| keys | No | Primary keys replacing the inferred ones. Default: inferred. Example: {"order_items": ["order_id", "line_no"]}. | |
| tmdl | No | {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 …"}. | |
| model | No | Existing semantic model in the workspace, by name or id. Default "" (only with tmdl). Example: "Sales model". | |
| schema | No | Schema in the source. Default "dbo". | dbo |
| source | Yes | Lakehouse, warehouse or SQL database, name or id. | |
| confirmed | No | Relationships the user confirmed, added to the plan. Default none. Example: [{"source": "orders", "source_cols": ["ship_to_id"], "target": "addresses", "target_cols": ["address_id"]}]. | |
| max_items | No | Cap on counting queries (one per key and relationship), 1–200. Default 60. | |
| workspace | Yes | Fabric workspace, name or id. | |
| check_data | No | true 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
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |