Skip to main content
Glama

extract_power_query

Extract the complete Power Query M code and query names from a .pbix file's DataMashup part. Read-only access to the underlying M definitions for auditing or analysis.

Instructions

Extract the full Section1.m (the plain-text Power Query M for every query) from a .pbix's DataMashup part, plus the declared query names. READ-ONLY. If there is no DataMashup part, the M is in the DataModel/TMDL - use get_table_m.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pbixPathYesabsolute path to the .pbix
Behavior4/5

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

The description explicitly declares the operation as READ-ONLY, which is a crucial behavioral trait given there are no annotations. It also states that the tool extracts from the DataMashup part and includes query names, giving a clear expectation of output. However, it does not detail what happens when the DataMashup part is absent (e.g., whether it errors or returns empty), though it points to an alternative.

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 two sentences with no fluff. The primary action and target are front-loaded, followed by a useful conditional alternative. Every clause earns its place, making it highly concise and structured.

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 there is no output schema, the description adequately explains what will be extracted (full Section1.m, declared query names) and the format (plain-text Power Query M). It also covers the edge case of missing DataMashup by directing to another tool, making it complete for a single-parameter tool.

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

Parameters3/5

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

The input schema already fully documents the single parameter pbixPath with a description ('absolute path to the .pbix'), achieving 100% coverage. The tool description does not add new parameter-level semantics beyond restating the .pbix context, so a baseline score of 3 is appropriate.

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 states a specific verb ('Extract'), a precise resource (the full Section1.m from the DataMashup part of a .pbix), and the additional output (declared query names). It also distinguishes itself from the sibling tool get_table_m by noting the alternative location for the M code when there is no DataMashup part.

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

Usage Guidelines5/5

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

The description provides an explicit conditional usage guideline: if there is no DataMashup part, the M is in the DataModel/TMDL and the user should use get_table_m instead. This clearly tells the agent when to use this tool versus an alternative.

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/cyphonica/powerbi-pbix-mcp'

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