save_open_pbix
Persist live model edits to an open .pbix by scripting File>Save, writing changes with data back to disk. For server datasets, triggers a refresh to flush pending changes.
Instructions
Persist an OPEN Power BI Desktop model to its .pbix by driving Desktop's own File>Save (scripted Ctrl+S), located by the session's engine port. This is the model-side 'save' the toolkit otherwise lacks: after any live model edit (add_measure, add_relationship, ...) call this to write the change - WITH data - back to disk without a manual click. Requires the .pbix open in Power BI Desktop. Pass pbixPath so the tool can confirm the save landed (LastWriteTime advanced). On an XMLA (Fabric/Service) session there is no local .pbix: the dataset persists server-side, so a pending M change is flushed by a full server-side refresh instead (ok:true, persisted:'xmla-refresh', saveDispatched:false; no Desktop is touched).
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": {
"sessionId": "<sessionId>"
},
"name": "save_open_pbix"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pbixPath | No | the open report's .pbix path (to confirm the save landed; optional) | |
| sessionId | Yes | sessionId from connect_model | |
| saveRetries | No | scripted File>Save attempts before giving up (default 2) |