Skip to main content
Glama

Memoreal — Deterministic AI Memory & Code Intelligence MCP

Get Structural Code Hierarchy

get_hierarchy
Read-onlyIdempotent

Retrieve nested directory-to-file-to-symbol tree structure up to a specified depth. Use when constructing an overview of codebase layout and file organization across directory levels.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

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

Input Schema

NameRequiredDescriptionDefault
rootNoStarting directory root (defaults to repository root).
max_depthNoMaximum tree depth (default 4).
namespaceYesLogical workspace namespace.

Output Schema

NameRequiredDescriptionDefault
rootYes
treeYes
namespaceYes
file_countYes
symbol_countYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds useful behavior beyond that: the output is a nested three-level tree (directory to file to symbol) bounded by a depth parameter, which tells the agent the response shape and that depth controls size. It omits any note on truncation or response size at large depths, keeping it short of a 5.

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?

Two tight sentences with the capability front-loaded and the usage cue second; nothing is padded. The trailing 'across directory levels' slightly echoes 'nested directory-to-file' but is minor.

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?

An output schema exists, so return values need not be explained, and all three parameters are schema-documented. For a simple read-only tree query, the definition covers scope, depth control, and intended use; only guidance on choosing among sibling traversal tools is missing.

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

Parameters3/5

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

Schema description coverage is 100% — root, max_depth (with default 4), and namespace are all documented in the schema. The description's 'up to a specified depth' only restates max_depth, adding no format, unit, or edge-case meaning, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (retrieve) and a well-defined resource ('nested directory-to-file-to-symbol tree structure up to a specified depth'), so an agent knows exactly what it returns. It does not name or distinguish itself from plausible siblings such as find_file, navigate, or build_context, so differentiation is left to inference.

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

Usage Guidelines3/5

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

Provides one clear positive cue: 'Use when constructing an overview of codebase layout and file organization across directory levels.' There are no exclusions, no cost/size caveats for deep trees, and no pointer to the sibling that would better serve a targeted lookup instead of a full overview.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.