Skip to main content
Glama

inheritance_chain

Trace a class's ancestors and descendants by name across the codebase index, optionally filtered to one repository, to map inheritance relationships before refactoring.

Instructions

Returns the inheritance chain for a class: ancestors (what it extends) and descendants (what extends it). Searched by class name across the index.

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": {
      "class_name": "<class_name>"
    },
    "name": "inheritance_chain"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoNoFilter to a specific repository (as shown in list_repos)
class_nameYesClass name to analyze

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.10.2

TDQS

A3.5/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It does disclose a meaningful behavioral trait beyond the schema, namely that traversal goes both directions (ancestors and descendants) and that lookup goes "across the index", implying only indexed code is visible. It omits what happens when a class name is ambiguous or not found, and whether the result is capped or paginated.

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 compact sentences, front-loaded with the return content and followed by the lookup mechanism. Every phrase earns its place; nothing is redundant with the title or schema.

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

Completeness3/5

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

This is a read-only lookup tool with only two simple parameters, so the description's small footprint is close to sufficient. However, with no output schema and no annotations, the description should say roughly what shape the result takes (name lists vs graph objects) and how duplicate class names across repos are resolved.

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 coverage is 100%, so both parameters are already documented, including the repo filter tied to list_repos. The description reinforces class_name as the search key and adds "across the index" scope context, but says nothing about the repo filter or how names are matched, so it does not exceed the 3 baseline.

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 gives a specific verb and resource ("Returns the inheritance chain for a class") and even disambiguates the two halves of the result, ancestors vs descendants, with parenthetical definitions. It stops short of a 5 because it never names a sibling it is distinct from, so the agent must infer its position relative to find_code or cross_repo_impact.

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?

Usage is only implied: the phrase "searched by class name across the index" hints this is an index-backed lookup for class-hierarchy questions, but there is no explicit when-to-use, when-not-to-use, or named alternative. An agent can guess that a hierarchy question routes here, but nothing steers it away from find_code for plain symbol lookup.

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