Skip to main content
Glama
ducnguyen221

powerbi-agent

by ducnguyen221

add_measure_local

Create or update a DAX measure directly in the open Power BI Desktop model, specifying table, name, expression, and optional format string.

Instructions

Tạo mới hoặc cập nhật một Measure DAX trực tiếp vào mô hình Power BI Desktop đang mở (TOM). Với thao tác modeling hàng loạt/phức tạp, ưu tiên MCP powerbi-modeling (Microsoft) nếu có.

  • port / model_id: lấy từ list_local_reports.

  • table_name: bảng chứa Measure (ví dụ: 'Sales').

  • measure_name: tên Measure (ví dụ: 'Total Sales').

  • expression: công thức DAX (ví dụ: 'SUM(Sales[Amount])').

  • format_string: định dạng hiển thị (ví dụ: '#,0' hoặc '0.0%').

  • description: mô tả ghi chú.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portYes
model_idYes
expressionYes
table_nameYes
descriptionNo
measure_nameYes
format_stringNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose the upsert nature ('create or update') and that it writes directly via TOM, which is meaningful, but it omits permissions, failure behavior, and what happens to a pre-existing measure of the same name.

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?

Purpose is front-loaded, followed by the alternative-tool caveat and then a tight per-parameter list. No filler sentences, and each line earns its place.

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?

An output schema exists so return values need not be explained, and the description covers the parameters and the key alternative. The remaining gap is behavioral detail (auth, overwrite-on-existing, bulk limits) for an unannotated mutation tool.

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 description coverage is 0%, so the description must compensate and largely does: it annotates port/model_id (source: list_local_reports), table_name, measure_name, expression, format_string and description with examples. Examples add real value beyond the bare schema property names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb pair plus resource: create or update a DAX Measure in the currently open Power BI Desktop model via TOM. That is unmistakably different from execution-oriented siblings like execute_dax_local. It is clear, though it does not explicitly name the sibling it complements.

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?

It gives an explicit when-not and alternative: for bulk/complex modeling operations prefer the Microsoft powerbi-modeling MCP if available. This routes the agent usefully, though it gives no guidance on local vs service model targets or on the create-vs-update decision.

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