Skip to main content
Glama

get_type_hierarchy

Inspect class and interface inheritance to retrieve base classes or derived types for a symbol at a specified file location, clarifying type relationships.

Instructions

Inspect class and interface inheritance hierarchy. direction='supertypes' returns base classes/interfaces; direction='subtypes' returns derived types.

Input Schema

NameRequiredDescriptionDefault
lineYes
characterYes
directionNosupertypes
file_pathYes
symbol_nameNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden, and it does disclose that output shape varies materially by direction mode — useful context. However, it never states that this is a read-only, non-mutating inspection, nor anything about language-server availability, failure behavior for invalid positions, or cost.

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?

Two sentences, front-loaded with the purpose, then the mode semantics. Every clause earns its place and there is no boilerplate.

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

Completeness2/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 described. But for a 5-parameter position-based tool with zero annotation coverage and zero schema descriptions, the agent is left without the coordinate conventions or the role of `symbol_name`, which are exactly what the description should supply.

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

Parameters2/5

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

Schema description coverage is 0% across 5 parameters, so the description must compensate and it does not. It only disambiguates `direction` (with its two values); `file_path`, `line`, `character`, and `symbol_name` — including whether line/character are 0- or 1-based, and what `symbol_name` is for when a position is already required — are left completely unexplained.

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?

The description opens with a specific verb and resource: 'Inspect class and interface inheritance hierarchy,' which immediately separates it from get_diagnostics or find_references. It never names a sibling explicitly, so an agent must infer the boundary, but the object of the operation is unambiguous.

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?

It explains the two modes of `direction` ('supertypes' for bases, 'subtypes' for derived), which is genuine usage guidance for the main decision point. It gives no guidance on when to prefer this over find_references or go_to_definition, and no prerequisites such as needing an active language server or an open file.

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