Skip to main content
Glama
ducnguyen221

powerbi-agent

by ducnguyen221

distill_template

Converts a Power BI report page into a reusable template kit with sanitized placeholders and verbatim visual blocks, without modifying the source report.

Instructions

Chưng cất 1 trang báo cáo PBIR thành template kit tái dùng (blueprint.md + blocks/*.json verbatim mỗi loại visual + _page.json + kit.json).

  • report_path: file .pbip, folder *.Report, hoặc folder definition.

  • page: GUID trang hoặc displayName chính xác.

  • out_dir: thư mục ghi kit — mặc định nên là templates/ trong THƯ MỤC DỰ ÁN (ngoài repo).

  • sanitize: MẶC ĐỊNH True — thay tên bảng/cột/nhãn thật bằng placeholder TEMPLATE_*. Đặt False chỉ khi user nói RÕ kit này dùng nội bộ và chấp nhận giữ tên nghiệp vụ thật. Mặc định phải an toàn: kit từng lọt tên measure thật của khách ra bản public vì an toàn phụ thuộc vào việc người gọi nhớ bật cờ. CHỈ ĐỌC — không sửa báo cáo nguồn.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageYes
out_dirYes
kit_nameNo
sanitizeNo
report_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

A4.1/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: 'CHỈ ĐỌC — không sửa báo cáo nguồn' declares the tool does not mutate the source report, and it discloses the safety-critical default (sanitize=True) with the reasoning behind it. It stops short of covering failure modes or what happens to unlisted behavior.

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 purpose sentence before per-parameter bullets, and every bullet carries real information. The heavy emphasis markers and the length of the sanitize rationale make it slightly denser than necessary, but nothing is filler.

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 no explanation, and the description covers the mutation-risk and parameter semantics an agent needs. The only gap is the undocumented kit_name parameter, which is minor for a 5-param 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 it documents 4 of 5 parameters in meaningful detail (report_path accepted forms, page GUID vs displayName, out_dir default location, sanitize semantics). Only kit_name is left undocumented.

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 ('Chưng cất' / distill) on a specific resource (one PBIR report page) and enumerates the exact artifacts produced (blueprint.md, blocks/*.json, _page.json, kit.json). This clearly separates it from siblings like distill_model_schema, distill_report_design, and apply_template.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The sanitize bullet gives conditional guidance (set False only if the user explicitly says the kit is internal), which is genuinely useful. However, it never states when to reach for distill_template instead of apply_template or distill_report_design, so the alternative-selection guidance remains implicit.

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