Skip to main content
Glama

type_hierarchy

Identify a type's hierarchy by providing its file, line, and column to see supertypes and subtypes, clarifying inheritance relationships.

Instructions

Get the type hierarchy (supertypes and subtypes) for the type at the given position.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
colYesColumn number (1-indexed)
fileYesRelative file path from project root
lineYesLine number (1-indexed)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the action (get hierarchy) without mentioning potential side effects, error behavior, or what happens if the position does not correspond to a type. There is no explicit indication that this is a read-only operation, nor any detail about the return structure.

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, concise sentence that front-loads the verb and resource. There is no extraneous wording, and every word contributes to conveying the tool's purpose. It is well-structured and efficient.

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?

For a tool with no output schema and no annotations, the description is too terse. It does not explain what the returned hierarchy consists of (e.g., a list of type names, supertypes vs. subtypes separately) nor how to interpret the result. It also omits edge cases such as what happens if the position does not point to a type, leaving the agent with insufficient information to correctly use the tool's output.

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?

The input schema already provides full descriptions for all three parameters (file, line, col) with 100% coverage. The tool description adds no additional semantic information about these parameters, so it relies entirely on the schema. Given the high schema coverage, a baseline of 3 is appropriate.

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 specifies the verb 'Get' and the resource 'type hierarchy (supertypes and subtypes)', and identifies the input as 'the type at the given position'. It is distinct from sibling tools like call_hierarchy_incoming/outgoing because it focuses on type relationships rather than call relationships. No ambiguity remains about the core purpose.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention any conditions, exclusions, or reference sibling tools such as goto_type_definition or call hierarchy tools. An agent receives no context about when this tool is the appropriate choice.

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