Skip to main content
Glama

add_template_measure

Add a measure to a table in a closed Power BI (.pbit) template by editing its model JSON on disk. Checks for name collisions and creates a .bak backup.

Instructions

Add a measure to a table in a closed .pbit template's model, editing the DataModelSchema JSON on disk with no Power BI Desktop. Collision-checked: fails if a measure of that name already exists on the table. The .pbit is written back in place (the original is copied to a .bak beside it first).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesmeasure name
tableYeshome table for the measure
pbitPathYespath to the closed .pbit template
expressionYesDAX expression, e.g. SUM(Sales[Amount])
formatStringNoformat string, e.g. "#,0" or "0.0%" (optional)
displayFolderNodisplay folder (optional)
Behavior5/5

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

With no annotations provided, the description takes full responsibility for behavioral disclosure. It goes beyond the basic action by revealing critical details: it edits the DataModelSchema JSON on disk, performs collision checking (fails if measure already exists), writes the .pbit back in place, and creates a .bak backup. This provides substantial transparency about side effects and failure conditions.

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 three sentences long, perfectly sized for the tool's complexity. It front-loads the core purpose in the first sentence, then adds key behavioral details (collision checking and backup) in the next two. Every sentence adds value, with no redundancy or unnecessary information.

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?

Given the tool's moderate complexity, the description covers the main workflow (adding a measure to a closed template) and important safety details (backup, collision check). However, it does not specify success/return values or error handling beyond the collision case. Since there is no output schema, a note about what happens on success (e.g., returns the updated model info) would improve completeness. Still, the description is quite thorough for the operation described.

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?

The input schema covers 100% of parameters with descriptions, so per the baseline rule, a score of 3 is appropriate. The tool description adds no additional parameter semantics beyond what the schema already provides. The schema descriptions are short but sufficient for basic understanding, and the description does not clarify optional parameters like formatString or displayFolder beyond their schema entries.

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 clearly states the specific action (adding a measure) and the resource (a table in a closed .pbit template's model), and explicitly distinguishes itself from similar tools by noting it edits DataModelSchema JSON on disk without Power BI Desktop. This differentiates it from sibling tools like add_measure (presumably for open models) and update/delete_template_measure.

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?

The description provides clear context for when to use the tool: when working with a closed .pbit template and no Power BI Desktop. It implies offline/automated editing scenarios. However, it does not explicitly name alternative tools or state when not to use this tool versus add_measure or open/edit workflows, so it misses the 'when-not' guidance.

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