Skip to main content
Glama

pq_get_queries

Reads all Power Query M partitions from expressions.tmdl across tables, shared expressions, and parameters, with optional table filtering, to inspect and reuse queries in a Power BI project.

Instructions

Read all Power Query M partitions across tables and shared expressions/parameters from expressions.tmdl.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "projectPath": "<projectPath>"
    },
    "name": "pq_get_queries"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableNameNoOptional table name filter
projectPathYesPath to the .pbip file or project root folder

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. 'Read' and the reference to expressions.tmdl imply a non-mutating file read, but the description does not disclose permissions needed, error behavior for missing files, pagination, or what the returned partition data looks like.

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 definition is a single front-loaded sentence with no filler. It puts the core action and scope first, then names the source file.

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

Completeness3/5

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

The description identifies the source and broad scope, and the schema fully documents both parameters. However, with no output schema and no annotations, it does not explain the return structure, partition representation, or behavior when no queries exist, leaving some gaps for an agent invoking it.

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?

Schema description coverage is 100%, so the schema already explains projectPath and the optional tableName filter. The description's 'all' and 'across tables' wording adds a little scope context, but it does not add parameter meaning beyond the schema.

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 uses a specific verb, 'Read,' and identifies the exact resources: Power Query M partitions across tables plus shared expressions/parameters from expressions.tmdl. This clearly contrasts with mutating siblings such as pq_set_table_query and pq_upsert_expression.

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 description implies this is the retrieval/inspection tool by saying it reads all partitions, but it does not explicitly state when to use it instead of the set/upsert siblings or when not to use it. Usage is inferable from the read-only verb and sibling names, but not stated.

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