Skip to main content
Glama

add_visual_topn

Add a visual-level top N filter that ranks a field by a measure and keeps the top or bottom n entries within the visual's own query.

Instructions

Add a VISUAL-LEVEL Top N: rank rankTable[rankField] by byTable[byMeasure], keep the top/bottom n, with the ranking applied in the visual's own query (a Top node in prototypeQuery.Where). direction=Top|Bottom. Distinct from add_topn_filter (which writes a filter card).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYeshow many to keep
pageYespage name or displayName
visualYesvisual name (from list_visuals)
byTableYestable that owns the ranking measure
byMeasureYesthe measure that ranks
directionNoTop | BottomTop
rankFieldYesthe column being ranked/limited
rankTableYestable that owns the ranked field
reportSessionIdYes
Behavior3/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It explains the ranking is applied in the visual's own query (Top node in prototypeQuery.Where), which is valuable. However, it doesn't disclose whether an existing Top N is replaced or stacked, nor any permissions, reversibility, or side effects.

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?

Three compact sentences deliver a clear purpose, an implementation detail, and a sibling distinction. No word is wasted, and the most important information (what it does and how it differs) is front-loaded.

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 9-parameter tool with no output schema and no annotations, the description covers the core operation, implementation, and a sibling contrast. It lacks explicit guidance on conflicts with existing Top N or edge cases, but overall it is sufficiently complete for an 'add' operation.

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 coverage is 89%, so baseline is 3. The description adds relational meaning by showing how rankTable/rankField and byTable/byMeasure pair together, and clarifies the role of 'direction' and 'n'. This goes beyond individual schema descriptions to explain the parameter structure.

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 visual-level Top N, with a specific verb 'Add' and a concrete resource ('VISUAL-LEVEL Top N'). It also provides the ranking syntax and explicitly distinguishes itself from add_topn_filter, so the purpose is 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?

It explicitly distinguishes itself from add_topn_filter, which is a key alternative, and implies the intended context of visual-level ranking. However, it doesn't mention other related tools like add_dynamic_topn or when NOT to use this tool beyond the one contrast, so the guidance is clear but not exhaustive.

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