Skip to main content
Glama

pq_set_table_query

Create or replace the Power Query M partition script for a Power BI TMDL table, creating the table file when it does not exist.

Instructions

Create or replace the Power Query M partition script for a table in the TMDL semantic model (creates the table file if it does not exist yet).

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>",
      "tableName": "<tableName>",
      "mExpression": "<mExpression>"
    },
    "name": "pq_set_table_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoStorage mode (default: import)
tableNameYesTarget table name
mExpressionYesPower Query M script (e.g. let ... in ...)
projectPathYesPath to the .pbip file or project root folder
partitionNameNoOptional partition name (default: <tableName>-Partition)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden. It does disclose two important traits: the operation is an overwrite ('create or replace') and it has a filesystem side effect (creating the table file if it does not exist). It does not say whether existing partition content is destroyed, whether other partitions on the table are affected, or whether the model must be reloaded afterward.

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?

A single front-loaded sentence that leads with the core action and appends the non-obvious file-creation caveat in parentheses. No filler, no repetition of the title. Slightly dense but efficient.

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?

For a 5-parameter mutation tool with a fully-described schema and no output schema, the description covers the essential action and its main side effect. The remaining gap is whether a table with multiple partitions is fully replaced or only the named partition is set, which matters given the optional partitionName parameter.

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 every parameter including the mode enum and optional partitionName is already documented in the schema; the baseline of 3 applies. The description adds only the implicit mapping of tableName to the target table file and does not explain how partitionName interacts with replacement semantics.

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?

The description states a specific verb pair and resource: 'Create or replace the Power Query M partition script for a table in the TMDL semantic model.' That is far more precise than the name pq_set_table_query alone, and the parenthetical clarifies the side effect of creating the table file when absent. It does not distinguish itself from adjacent siblings like pq_upsert_expression or model_upsert_table, so it stops short of a 5.

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?

Usage is implied by the create-or-replace framing: use this when you want to set (or overwrite) a table's M partition. There is no explicit when-to-use vs. when-not-to-use guidance, no mention of prerequisites such as the project/table needing to be open or loaded, and no pointer to the sibling that handles model-level table creation.

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