Skip to main content
Glama

get_hierarchy

Read-onlyIdempotent

Browse instances and structural children below a given path in an elaborated SystemVerilog design, with depth and pagination controls for hierarchy inspection.

Instructions

Browse the instance tree below path (or the top instance). Use this for structural children; use find for design-wide name search or get_stats for aggregate model counts. Lists only non-assign children (real submodules + leaf primitives); assign glue is reported as assign_count, not enumerated. Each child carries a leaf flag (submodule vs leaf primitive). depth<=5; the non-assign set is paginated at the root via limit/cursor (next_cursor/has_more), deeper levels via children_truncated.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_hierarchy"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoHierarchical instance path; omit to start at the top instance.
depthNoTree depth from 1 through 5; out-of-range values are clamped.
limitNoMaximum non-assign children per level; root default 20, maximum 100.
cursorNoOpaque root-level next_cursor from a previous response.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.2.0
    • changedInput schema / properties / path / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed1 schema field changedv0.1.25
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "result": {
      +      "additionalProperties": true,
      +      "title": "Result",
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "result"
      +  ],
      +  "title": "get_hierarchyOutput",
      +  "type": "object"
      +}
  3. Changed4 schema fields changedv0.1.9
    • addedInput schema / properties / cursor / description
      Added value: +"Opaque root-level next_cursor from a previous response."
    • addedInput schema / properties / depth / description
      Added value: +"Tree depth from 1 through 5; out-of-range values are clamped."
    • addedInput schema / properties / limit / description
      Added value: +"Maximum non-assign children per level; root default 20, maximum 100."
    • addedInput schema / properties / path / description
      Added value: +"Hierarchical instance path; omit to start at the top instance."
  4. First observedv0.1.8

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare a safe read (readOnly, idempotent, non-destructive, closed-world), and the description adds substantial behavior beyond them: assign glue is collapsed into 'assign_count' rather than enumerated, each child carries a 'leaf' flag, depth is capped at 5, and pagination differs by level (limit/cursor at root, children_truncated deeper). These are non-obvious response-shape facts an agent cannot infer from annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and tool routing, then behavior and paging details in descending priority; nearly every clause carries information. Minor redundancy in restating the non-assign children filter twice (once for the listing, once for pagination).

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

Completeness5/5

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

An output schema exists so return values need not be explained, yet the description still covers the pagination contract (next_cursor/has_more/children_truncated) that matters for correct looping. Nothing an agent needs to call this traversal tool safely and correctly is missing.

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 100%, so the baseline is 3, and the description still adds value the schema omits: limit/cursor are described as applying only at the root level and cursor as an opaque next_cursor from a prior response. Depth's clamping is restated from the schema rather than extended, keeping this just short of a 5.

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?

States a specific verb and resource ('Browse the instance tree below path'), defines the default scope (top instance), and immediately distinguishes itself from 'find' and 'get_stats' by what each returns. An agent can identify the right tool without opening any schema.

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

Usage Guidelines5/5

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

Explicitly routes the agent: 'Use this for structural children; use find for design-wide name search or get_stats for aggregate model counts.' The condition that selects this tool versus its two named alternatives is stated outright.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.