Skip to main content
Glama
ducnguyen221

powerbi-agent

by ducnguyen221

distill_model_schema

Extract the schema of an open Power BI Desktop model—tables, columns, relationships, and measures—into a Markdown blueprint with a Mermaid ERD for AI agents writing DAX and designing reports.

Instructions

Trích xuất cấu trúc mô hình dữ liệu (bảng, cột, quan hệ, measure) của báo cáo Power BI Desktop đang mở thành tài liệu Markdown blueprint (kèm sơ đồ Mermaid ERD) để Agent tham chiếu khi viết DAX / thiết kế báo cáo.

  • port / model_id: để trống sẽ tự dò (nếu chỉ có 1 báo cáo đang mở).

  • output_filename: tên file .md (mặc định 'distilled_model_.md').

  • output_dir: thư mục ghi; mặc định env POWERBI_DISTILL_DIR hoặc <thư mục dự án>/distilled/. LƯU Ý: schema model có thể nhạy cảm (tên bảng/cột/công thức nghiệp vụ) — đừng ghi vào repo public.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
portNo
model_idNo
output_dirNo
output_filenameNo

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 provided, the description carries the full burden and discloses important behavior: auto-detection of an open report when port/model_id are blank, default output filename and directory, environment variable fallback, and a sensitivity warning about not writing to public repos. It still lacks failure-mode details, such as what happens if multiple reports are open.

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 front-loaded with the core purpose, then uses a compact bullet list for parameter behavior and a final warning. Every sentence adds useful information, with no filler or repetition.

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 an output schema exists, the description does not need to explain return values, and it focuses on invocation behavior, defaults, and a security note. It is largely complete for a four-parameter extraction tool, though it could mention prerequisites like Power BI Desktop being open or the failure case when multiple reports are open.

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 does: it explains that port/model_id are auto-detected if blank when only one report is open, and it gives defaults for output_filename and output_dir. It does not distinguish port from model_id individually, but covers all four parameters at a practical level.

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?

States a specific verb and resource: extracting the data model structure (tables, columns, relationships, measures) of an open Power BI Desktop report into a Markdown blueprint with Mermaid ERD. This is clear enough to distinguish it from report-design or template tools, though it does not explicitly name sibling alternatives.

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?

Provides clear context: use the output as a reference when writing DAX or designing reports. It does not explicitly state when not to use it or name alternative sibling tools, but the intended use case is unambiguous.

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