Skip to main content
Glama

add_hierarchy

Turn ordered columns into drill-down hierarchies for deeper data analysis. Works with live sessions or offline PBIP files.

Instructions

Create a drill-down hierarchy on a table from an ordered, comma-separated list of existing columns (e.g. "Year,Quarter,Month" or "Segment,Subsegment,ItemDesc"). target=pbip: pass pbipFolder instead of sessionId to apply the same edit OFFLINE to a PBIP semantic model's TMDL (no engine).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNohierarchy name
tableNothe table to build the hierarchy on
levelsNoordered column names, comma-separated
sessionIdNosessionId from connect_model (live engine; pass exactly one of sessionId / pbipFolder)
pbipFolderNotarget=pbip: a PBIP <name>.SemanticModel / TMDL definition folder to edit OFFLINE (engine-free)
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses the offline PBIP TMDL behavior ('no engine') and the requirement of existing columns. However, it does not mention what happens on conflicts (e.g., if a hierarchy with the same name already exists), whether levels are validated, or any side effects beyond creation.

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 a single, well-structured sentence that front-loads the main purpose, provides parenthetical examples, and then introduces the offline mode. Every word contributes meaning with no fluff or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters and no output schema, the description covers the primary usage and the offline variant. However, it does not explicitly state that exactly one of sessionId or pbipFolder must be supplied (schema shows 0 required but description implies 'instead of'), nor does it describe the expected return value or success/failure behavior. This leaves gaps for an AI agent.

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 100%, providing a baseline of 3. The description adds value by clarifying the relationship between sessionId and pbipFolder ('pass pbipFolder instead of sessionId') and explicitly defining the levels format as an ordered, comma-separated list with examples. This goes beyond the schema's brief descriptions.

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 function: 'Create a drill-down hierarchy on a table from an ordered, comma-separated list of existing columns.' It provides concrete examples and distinguishes this from siblings like add_hierarchy_level by specifying the creation of the entire hierarchy rather than adding a single level.

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 gives clear context for using the tool (building a hierarchy from existing columns) and explains the pbip offline mode as an alternative to using sessionId. However, it does not explicitly state when not to use this tool versus related tools like set_hierarchy_properties, leaving some room for ambiguity.

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