Skip to main content
Glama
HorizunGroup

Horizun PBI MCP

Official
by HorizunGroup

pbi_get_power_query

Read-only

Retrieve the Power Query (M) definition from a .pbip partition or named expression, with its SHA-256 hash to enable safe updates. Read-only extraction from TMDL.

Instructions

Lee la consulta Power Query (M) de una particion o expresion.

En un .pbip el M no tiene archivo propio: vive dentro del TMDL, en la partition de cada tabla y en expressions.tmdl. Esta tool lo saca tal cual, con su SHA-256, que es lo que despues acepta pbi_update_power_query como expected_sha256 para no escribir sobre una version que ya cambio.

table + name seleccionan una particion; name con kind='expression', una expresion con nombre. Si la seleccion queda ambigua o no existe, el error trae la lista de candidatos.

Solo lectura, y solo lectura de TEXTO: nadie ha ejecutado esta consulta. No hay motor M fuera de Power BI Desktop.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindNo
nameNo
tableNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Beyond the readOnlyHint annotation, the description states that the tool is read-only text access, does not execute the M query, and has no M engine outside Power BI Desktop. It also discloses the SHA-256 output and error behavior with candidate lists, adding substantial behavioral context.

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 dense but every sentence earns its place: the main action is front-loaded, selection semantics are precise, error behavior is covered, and the safety note about not executing queries is valuable. It is appropriately sized for a tool with subtle selection logic.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of partition-vs-expression selection and the 0% schema coverage, the description is remarkably complete. It explains where M lives in a .pbip, how to select the target, what is returned, how the result is consumed by pbi_update_power_query, and what happens on ambiguity. An output schema exists, so return-value details do not need to be duplicated.

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 carries the full burden of explaining parameters. It clearly defines the roles of table, name, and kind, and explains how they combine, including the special kind='expression' case. It could be more explicit about value formats, but the guidance is sufficient for invocation.

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 opens with a specific verb and resource: reads the Power Query (M) of a partition or expression. It also clarifies the .pbip/TMDL context and the SHA-256 return value, which clearly distinguishes it from sibling tools like pbi_list_partitions or pbi_get_object.

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 gives detailed selection guidance: table + name select a partition, while name with kind='expression' selects a named expression, and ambiguous/nonexistent selections produce a candidate list. It does not explicitly contrast with other read tools, but the context strongly implies when this tool is appropriate.

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/HorizunGroup/horizun-pbi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server