Skip to main content
Glama

add_topn_filter

Add a top-N or bottom-N filter to a visual, page, or report, keeping only the highest- or lowest-ranked items based on a specified measure.

Instructions

Add a TOP-N (or bottom-N) filter at a scope=visual|page|report: keep the top/bottom n of table[field] ranked by byTable[byMeasure]. direction=top|bottom. For scope=visual pass page+visual; scope=page pass page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYeshow many to keep
pageNopage (scope=visual|page)
fieldYesthe column being ranked/limited
scopeYesvisual | page | report
tableYestable that owns the field to rank
visualNovisual (scope=visual)
byTableYestable that owns the ranking measure
byMeasureYesthe measure that ranks
directionNotop | bottomtop
reportSessionIdYes
Behavior3/5

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

With no annotations provided, the description carries the full burden. It explains the core behavior (keep top/bottom n of a field ranked by a measure) and mentions the direction parameter. However, it does not disclose whether the filter replaces or appends to existing filters, whether it is idempotent, or any side effects. The behavior of the filter after creation is not explained beyond the ranking logic.

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 concise sentences with no wasted words. It packs the essential information: the operation, the scope options, the ranking logic, the direction, and scope-specific parameter hints. It is well-structured and easy to parse.

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?

The tool has 10 parameters and no output schema, so the description must cover the main logic and parameter relationships. It does this well by explaining the ranking mechanism and scope handling. However, it omits edge cases like what happens when no page/visual is provided for scope=report, or how multiple TOP-N filters interact. Given the moderate complexity, this is reasonably complete but not exhaustive.

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?

Schema description coverage is 90%, so the baseline is 3. The description adds value by explaining the relationship between parameters (table[field] ranked by byTable[byMeasure]) and the conditional requirements for page/visual based on scope. This goes beyond the individual schema descriptions, clarifying how the parameters interact.

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: adding a TOP-N or bottom-N filter with a specific scope (visual/page/report). It explicitly describes the ranking logic (keep top/bottom n of table[field] ranked by byTable[byMeasure]), which distinguishes it from generic filter tools. The verb 'Add' and the resource (filter) are specific and unambiguous.

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 provides concrete usage guidance for the scope parameter: for scope=visual, pass page+visual; for scope=page, pass page. This tells the agent how to set parameters correctly for each scope. It does not mention alternative tools or when not to use this tool, but the context is clear enough for most scenarios.

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