Skip to main content
Glama

type_hierarchy

Reveal inheritance and polymorphism by displaying a type's supertypes and subtypes. Accepts a symbol name or file position, snapping off-target positions to the enclosing symbol.

Instructions

Show the type hierarchy for a type: its supertypes (interfaces it implements, embedded types) and subtypes (types that implement or embed it). PREFER a name (uri + symbol_name) — plumb resolves the exact identifier position for you, avoiding off-by-one errors; a raw file position (uri + line + character) is the fallback and, when it lands off an identifier, is snapped to the enclosing symbol. Useful for understanding inheritance and polymorphism.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriNoAbsolute path, file:// URI, or workspace-relative path containing the type
lineNoZero-based line number of the type. Required when symbol_name is not provided.
characterNoZero-based character offset within the line. Required when symbol_name is not provided.
directionNoWhich direction to traverse: parent types (supertypes), child types (subtypes), or both. Defaults to both.
symbol_nameNoSymbol name to look up instead of a position — PREFERRED over line/character. Accepts plain name or ReceiverType.MethodName form. plumb resolves it against the file's symbols, avoiding the off-by-one and 'no identifier found' errors of a hand-computed position. When provided, line and character are not needed.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed4 schema fields changedv0.17.0
    • changedInput schema / properties / character / description
      Previous value: -"Zero-based character offset within the line"New value: +"Zero-based character offset within the line. Required when symbol_name is not provided."
    • changedInput schema / properties / line / description
      Previous value: -"Zero-based line number of the type"New value: +"Zero-based line number of the type. Required when symbol_name is not provided."
    • addedInput schema / properties / symbol_name
      Added value: +{
      +  "description": "Symbol name to look up instead of a position — PREFERRED over line/character. Accepts plain name or ReceiverType.MethodName form. plumb resolves it against the file's symbols, avoiding the off-by-one and 'no identifier found' errors of a hand-computed position. When provided, line and character are not needed.",
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "line",
      -  "character"
      -]
  2. First observedv0.16.6

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are present, so the description carries the full burden. It discloses important behaviors: identifier positions are resolved by plumb to avoid off-by-one errors, and positions off an identifier are snapped to the enclosing symbol. It does not mention read-only status or potential errors, but the transparency provided is meaningful.

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 concise and well-structured: first sentence defines what it does, second explains parameter preference, and third gives the use case. Every sentence contributes necessary information with no fluff.

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?

The description covers core purpose, parameter selection, and use case, while the schema fully documents all parameters. The main gap is the lack of output format (e.g., whether it returns a tree or list), which is somewhat important given there is no output schema, but the description is still adequate for correct invocation.

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. The description adds value by explaining why symbol_name is preferred over line/character, describing off-by-one risks, and the snapping fallback. This enriches the parameter semantics beyond the schema's own 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 a specific verb and resource: 'Show the type hierarchy for a type' and elaborates with concrete definitions of supertypes and subtypes. It implicitly distinguishes from siblings like call_hierarchy by focusing on inheritance/embedding relationships rather than call relationships.

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 when to use the tool ('Useful for understanding inheritance and polymorphism') and provides usage guidance on preferring symbol_name over line/character to avoid off-by-one errors. However, it does not explicitly name alternative sibling tools or state when not to use this tool.

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

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/plumbkit/plumb'

If you have feedback or need assistance with the MCP directory API, please join our Discord server