Skip to main content
Glama

keep_top_rows

Keep only the first N rows of a table in Power Query by appending Table.FirstN to the M query.

Instructions

Power Query Keep Top Rows: keep only the first N rows. Appends Table.FirstN to the table's M query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYesnumber of rows to keep from the top
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?

With no annotations, the description carries the burden of behavioral disclosure. It does add useful context by stating 'Appends Table.FirstN to the table's M query', revealing that it modifies the query. However, it does not disclose whether this is reversible, whether permissions are needed, or any side effects on existing steps.

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 two sentences, front-loaded with the purpose, and includes an implementation detail without being verbose. Every word contributes to understanding the tool.

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 operation, the description covers the core functionality and even mentions the M query modification. However, it omits guidance on related tools and doesn't explain the undocumented table/sessionId parameters, leaving some gaps relative to the schema richness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema describes count and partitionName, but table and sessionId lack descriptions. The description does not compensate for these undocumented parameters; it only clarifies the 'count' parameter implicitly through 'first N rows', which is already in 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 clearly states the action ('keep only the first N rows') and identifies the resource (the table's M query). It distinguishes from siblings like keep_bottom_rows and keep_range_rows by specifying 'top' rows.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as filter_rows, keep_bottom_rows, or skip_rows. The description only states what it does, not when to choose it over other row-manipulation tools.

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