Skip to main content
Glama

sort_rows

Sort rows in a Power BI table by one or more columns with optional ascending or descending direction, appending Table.Sort to the M query.

Instructions

Power Query Sort Rows: sort by one or more columns. Appends Table.Sort to the table's M query. sorts is comma-separated as column[:direction], e.g. "Region:Ascending,Sales:Descending". direction = Ascending | Descending (default Ascending).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortsYessort keys as column[:direction], comma-separated
tableYes
sessionIdYes
partitionNameNopartition name (optional; defaults to the first partition)
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 burden. It discloses that the tool appends Table.Sort to the M query, which is a useful behavioral detail. However, it does not address reversibility, error handling, or whether existing sorts are replaced, leaving some ambiguity.

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 concise and well-structured. It opens with the purpose, then provides the mechanism (M query append) and concrete format example, with no redundant words.

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 simple sort operation with no output schema, the description covers the primary syntax, behavior, and parameter format. It does not explicitly explain sessionId/table, but these are standard in the context of the sibling tools. The description is sufficiently complete for an agent to invoke the tool correctly.

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 schema covers 50% of parameters (only sorts has a description). The description adds significant value by explaining the sort key format, allowed directions, and default direction with an example. However, it does not clarify what 'table' or 'sessionId' mean, which would help in a multi-tool environment.

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's purpose: sorting rows in a Power Query table by one or more columns. The verb 'sort' and resource 'rows' are specific, and the description distinguishes it from sibling tools like 'sort_column_by' (which sorts a column in a visual) and filtering tools.

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 implicitly conveys when to use this tool (to sort table rows in Power Query) and provides example syntax. It does not explicitly mention alternative tools or when not to use it, but the context is clear enough for an agent to select it for sorting operations.

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