Skip to content

extract_superclass

MCP tools › Code insight and refactoring

Extract Superclass for the class at (or around) a position of a JavaScript or TypeScript file: creates class name before it with the chosen members, moves them there and makes the class extend it. dry_run defaults to true and returns the edits per file; dry_run=false writes them. Refuses with the reasons when it cannot.

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

Capabilitycode.extract_superclass
AreaCode insight and refactoring
Accesschanges files
Reaches—
Rightswrite
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
pathrequiredstringWorkspace-relative file path.
linerequiredinteger0-based line.minimum 0
characterrequiredinteger0-based character in the line (Unicode scalar values).minimum 0
namerequiredstringThe name of the new type.
membersrequiredarray of stringNames of the chosen members (see class_members).
dry_runbooleanOnly report the edits (default true).

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 extract_superclass '{"path":"<string>","line":1,"character":1,"name":"<string>","members":[]}'
Input schema as JSON
{
"type": "object",
"required": [
"path",
"line",
"character",
"name",
"members"
],
"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
},
"name": {
"description": "The name of the new type.",
"type": "string"
},
"members": {
"description": "Names of the chosen members (see `class_members`).",
"type": "array",
"items": {
"type": "string"
}
},
"dry_run": {
"description": "Only report the edits (default true).",
"type": [
"boolean",
"null"
]
}
}
}