Skip to main content
Glama

persist_model_edit

Persist Power BI model edits into .pbix, automatically choosing the right route (live Desktop or offline) and preserving data with atomic saves and backups.

Instructions

THE single entry to fix a measure / relationship / calculated column in a model AND persist it to the .pbix. Picks the best route for target and reports what it did plus what is / isn't preserved. target = an open model sessionId (from connect_model) -> live edit + scripted Power BI Desktop File>Save; DATA PRESERVED for ANY model (needs the .pbix open in Desktop). target = a cold .pbix PATH -> offline engine edit (ImageLoad->edit->ImageSave->repack); DATA PRESERVED, no Desktop, but ONLY for M-free / engine-native models. If the .pbix imports via Power Query (M) - a normal data report - the offline route cannot host it and the result explains to open it in Desktop and pass the sessionId instead. edits = a JSON array of edit objects (see the tool-type summary). A .bak backup is taken and the write is atomic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
editsYesJSON array of edit objects, each with an "op" (add_measure, add_relationship, add_calculated_column, ...)
targetYesan open model sessionId (data-preserving via Desktop) OR a cold .pbix path (offline, M-free only)
pbixPathNothe .pbix path to confirm the save landed (only used for the live/Desktop route; optional)
saveRetriesNoscripted File>Save attempts before giving up (live route; default 2)
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: it mentions taking a .bak backup, atomic writes, reporting what is/isn't preserved, and the specific mechanics of each route (ImageLoad->edit->ImageSave->repack). It also states the limitation for Power Query (M) models and how the tool will guide the user, which goes beyond basic safety hints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single dense paragraph with clear topic segmentation: purpose, target routes, data preservation, edit format, and safety guarantees. Every sentence provides necessary information without fluff. It's front-loaded and well-organized, making it easy to scan despite the technical complexity.

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

Completeness5/5

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

For a tool with no output schema and no annotations, the description covers all essential contexts: what edits are supported, how the two routes behave, data preservation conditions, limitations, and safety features (backup, atomic write). It even explains error behavior for M models. It leaves little ambiguity for an agent to select and invoke this tool correctly.

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 meaningful context by explaining that 'target' can be a sessionId or a path, how the route is chosen based on target, and that 'edits' is a JSON array with ops (though it defers to the tool-type summary for details). It also clarifies pbixPath's optional nature and saveRetries' purpose, adding value beyond the schema.

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?

The description opens with 'THE single entry to fix a measure / relationship / calculated column in a model AND persist it to the .pbix', which is a specific verb+resource combination that clearly distinguishes it from siblings like add_measure or persist_open_model. It also explains the two routes (live session vs offline path), reinforcing its unique role.

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?

It explicitly tells when to use the live route vs the offline route based on the target type and model characteristics ('DATA PRESERVED for ANY model' vs 'ONLY for M-free / engine-native models'). It also explains the fallback for M models: 'the result explains to open it in Desktop and pass the sessionId instead', which is clear guidance on alternatives and prerequisites.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cyphonica/powerbi-pbix-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server