Skip to content

type_hierarchy

MCP tools › Code insight and refactoring

Type hierarchy of the type at (or around) a position of a Java file (from jdtls, SPEC-0082 v5), a Kotlin file (from the project's syntax trees, SPEC-0082 v6: project types only, a library supertype is a leaf placed where it is named) or a JavaScript/TypeScript file (without typescript-language-server, or when it fails, from the project's syntax trees through imports and re-exports, v5): direction class (default) gives the superclass chain from the topmost class down to the type (marked *) with all its subtypes below; supertypes and subtypes start at the type. Each node has name, kind, detail (package), location and children; at most 500 nodes. Returns null when there is no type.

Its results carry text from files, language_server: the client is told to treat that as data, never as instructions.

Capabilitycode.type_hierarchy
AreaCode insight and refactoring
Accessreads only
Reachesprocess
Rightsnone
Dry runnone

Arguments

ArgumentTypeDescription
pathrequiredstringWorkspace-relative .java file.
linerequiredinteger0-based line.minimum 0
characterrequiredinteger0-based character in the line (Unicode scalar values).minimum 0
directionstringclass (default: superclass chain down to the type, then its subtypes), supertypes or subtypes.

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project type_hierarchy '{"path":"<string>","line":1,"character":1}'
Input schema as JSON
{
"type": "object",
"required": [
"path",
"line",
"character"
],
"properties": {
"path": {
"description": "Workspace-relative `.java` file.",
"type": "string"
},
"line": {
"description": "0-based line.",
"type": "integer",
"minimum": 0
},
"character": {
"description": "0-based character in the line (Unicode scalar values).",
"type": "integer",
"minimum": 0
},
"direction": {
"description": "`class` (default: superclass chain down to the type, then its subtypes), `supertypes` or\n`subtypes`.",
"type": [
"string",
"null"
]
}
}
}