Skip to main content
Glama

add_conditional_column

Add a conditional column to a Power Query table by defining ordered if-then-else rules that map column values to results.

Instructions

Power Query Add Conditional Column: add a column from an ordered if/then/else rule chain (the structured Conditional Column builder). Appends Table.AddColumn with a nested if-chain to the table's M query. rules is comma-separated as column:op:value:result, e.g. "Score:ge:90:A,Score:ge:80:B". op = eq | ne | gt | ge | lt | le | contains | startswith | endswith. valueType types the compared values; resultType types the results (text | number | logical | null).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesthe new column name
rulesYesrules as column:op:value:result, comma-separated
tableYes
sessionIdYes
valueTypeNovalue type for comparisons: text | number | logical | null (default text)text
elseResultNothe else/default result when no rule matches
resultTypeNoresult type: text | number | logical | null (default text)text
partitionNameNopartition name (optional; defaults to the first partition)
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It transparently states that it appends Table.AddColumn to the table's M query (a mutation) and details the rule format and operators. However, it does not mention side effects like existing-column overwrites, error conditions, or prerequisites, which would have elevated it further.

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?

The description is dense but well-structured, front-loading the core purpose, then detailing syntax, operators, and types. Every sentence contributes, though the rule example and operator list make it moderately verbose. It is appropriately sized for a tool of this complexity.

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 the tool has 8 parameters, no output schema, and no annotations, the description covers the essential elements: the operation's effect, rule format, operators, and type handling. It does not explain return values or error scenarios, but the core usage is sufficiently documented for an agent to invoke it.

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 schema covers 75% of parameters, but the description adds significant meaning beyond the schema by defining the exact comma-separated rule syntax (column:op:value:result), listing valid operators, and clarifying how valueType and resultType affect comparisons and outputs. This is valuable for invoking the tool correctly.

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 clearly states the tool adds a conditional column via an ordered if/then/else rule chain, explicitly mentioning the underlying Table.AddColumn with a nested if-chain. This distinguishes it from generic add_custom_column or add_calculated_column tools by focusing on the structured Conditional Column builder pattern.

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 conveys when to use this tool: when you need an ordered conditional column based on rules. It provides examples and operator lists, but it does not explicitly name alternatives or state when not to use it, so it lacks explicit exclusions while giving clear context.

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