Skip to main content
Glama
ducnguyen221

powerbi-agent

by ducnguyen221

apply_template

Create a new page in a PBIR report by cloning and rebinding visuals from a template kit, avoiding manual layout work; close the .pbip in Power BI Desktop first.

Instructions

Dựng TRANG MỚI vào báo cáo PBIR từ template kit (clone-and-rebind — không dựng layout từ đầu). ⚠️ File .pbip phải ĐANG ĐÓNG trong Power BI Desktop (mở + Ctrl+S sẽ đè mất trang mới).

  • report_path: file .pbip, folder *.Report, hoặc folder definition (SẼ GHI vào đây).

  • kit_dir: thư mục kit (tạo bởi distill_template, hoặc report-templates/ có sẵn — xem list_templates).

  • page_spec: JSON string: {"displayName": "Tên trang", "visuals": [ {"block": "cardVisual", "x": 30, "y": 100, "z": 1000, "width": 280, "height": 110, "visualType": "(tùy chọn — đổi loại chart, phải chỉnh roles khớp)", "title": "(tùy chọn — ghi đè text title, giữ style)", "fields": {"Data": [{"type": "Measure", "entity": "Công thức", "property": "Tổng TB"}]}} ]} Role theo loại: card/slicer=Values · cardVisual=Data · line/area/combo=Category/Y/Series · pivotTable=Rows/Columns/Values. Field type: Measure | Column. Trả về: đường trang mới + việc cần làm tay (mở lại Power BI để nghiệm thu).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kit_dirYes
page_specYes
report_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it flags a mutation ('SẼ GHI vào đây'), a concurrency constraint that data will be overwritten if the file is open, and the return payload (new page path + manual verification steps). It omits auth/permission requirements, keeping it from a 5.

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?

Front-loads the action, then the critical warning, then per-parameter semantics, then return value. Dense but every block earns its place; minor verbosity in the embedded JSON example is justified by the 0% schema coverage.

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?

For a complex mutation tool with no annotations and 0% schema coverage, the description covers the write target, the required environmental precondition, all three parameters, and the return contract. Complete enough to invoke correctly, though permission/error behavior is unaddressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate and does: it defines the three accepted forms of report_path, the origin of kit_dir, and a full JSON shape for page_spec including role mappings per visual type and field types (Measure | Column). This adds substantial meaning the schema lacks.

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?

States a specific verb and resource ('Dựng TRANG MỚI vào báo cáo PBIR từ template kit') and immediately scopes the mechanism ('clone-and-rebind — không dựng layout từ đầu'). This clearly separates it from siblings like distill_template (builds the kit) and list_templates (lists kits).

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?

Gives a concrete prerequisite ('File .pbip phải ĐANG ĐÓNG trong Power BI Desktop') and routes the agent to relevant siblings ('tạo bởi distill_template', 'xem list_templates'). It stops short of an explicit when-not/exclusion statement, but the workflow context is strong.

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