Skip to content

call_hierarchy

MCP tools › Code insight and refactoring

Call hierarchy of the function at a position of a workspace file, from its language server: direction callers lists who calls it, callees what it calls, as a tree depth levels deep (default 3, at most 10; at most 500 nodes). Each node has name, kind, detail, location, the call sites (in the caller's file) and whether it repeats an ancestor (recursion, not expanded). Returns null when there is no function at the position.

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

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

Arguments

ArgumentTypeDescription
pathrequiredstringWorkspace-relative file path.
linerequiredinteger0-based line.minimum 0
characterrequiredinteger0-based character in the line (Unicode scalar values).minimum 0
directionrequiredstringcallers (who calls the function) or callees (what it calls).
depthintegerLevels to expand, 1–10 (default 3).minimum 0

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 call_hierarchy '{"path":"<string>","line":1,"character":1,"direction":"<string>"}'
Input schema as JSON
{
"type": "object",
"required": [
"path",
"line",
"character",
"direction"
],
"properties": {
"path": {
"description": "Workspace-relative file path.",
"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": "`callers` (who calls the function) or `callees` (what it calls).",
"type": "string"
},
"depth": {
"description": "Levels to expand, 1–10 (default 3).",
"type": [
"integer",
"null"
],
"minimum": 0
}
}
}