Skip to main content
Glama

add_custom_column

Add a custom column to a Power BI table using an M expression that references existing columns, like [Qty] * [Price].

Instructions

Power Query Add Custom Column: add a column from an M expression. Appends Table.AddColumn(prev, name, each ) to the table's M query. The expression references other columns as [Col], e.g. "[Qty] * [Price]".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesthe new column name
tableYes
sessionIdYes
mExpressionYesthe M expression, e.g. [Qty] * [Price]
partitionNameNopartition name (optional; defaults to the first partition)
Behavior4/5

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

The description discloses that it appends Table.AddColumn to the table's M query, revealing the exact transformation and that the operation modifies the query. Since no annotations are provided, this carries the transparency burden, and while it doesn't mention error handling or side effects, the explicit M code gives strong behavioral insight.

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 three focused sentences that front-load the purpose and add essential detail without redundancy. It earns its place with a clear statement, a mechanism explanation, and a useful example—no fluff.

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 a 5-parameter tool with no output schema or annotations, the description covers the core mechanics and provides a usage example. It omits context about session/table handling and potential side effects, but the essential operation is clearly conveyed, leaving only minor gaps.

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?

The description clarifies that mExpression references columns as [Col] and provides a concrete example, adding context beyond the schema's basic description. It also shows how name and mExpression combine in the Table.AddColumn code, giving relational meaning that the schema alone lacks, though table and sessionId remain under-specified.

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 immediately states 'add a column from an M expression,' specifying the exact action and resource. It distinguishes this from sibling tools like add_calculated_column by emphasizing M expressions and provides a concrete example, making the purpose unmistakable.

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 phrase 'Power Query Add Custom Column' and the M expression syntax clearly indicate this is for Power Query transformations. It implies the right context (adding custom columns via M) but does not explicitly name alternatives or state when not to use it, landing just below the 'explicit alternatives' threshold.

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