Skip to content

delegate_methods

MCP tools › Code insight and refactoring

Delegate Methods for the Java class at a position (SPEC-0122 v4, through jdtls): without add lists its fields with the methods each can forward to (those every object has left out). With field and add (names as listed) adds forwarding methods; dry_run defaults to true and returns the new text, dry_run=false writes the file (needs the write right) and refuses if it changed meanwhile.

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

Capabilitycode.delegate_methods
AreaCode insight and refactoring
Accesschanges files
Reachesprocess
Rightswrite
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
pathrequiredstringWorkspace-relative .java file.
linerequiredinteger0-based line inside the class.minimum 0
characterrequiredinteger0-based character in the line.minimum 0
fieldstringWith add: the field to forward to.
addarray of stringMethods of the field to forward to (name or name(Type, …) as listed); empty only lists.
dry_runbooleanWith add: only return the new text (default true); false writes the file.

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 delegate_methods '{"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 inside the class.",
"type": "integer",
"minimum": 0
},
"character": {
"description": "0-based character in the line.",
"type": "integer",
"minimum": 0
},
"field": {
"description": "With `add`: the field to forward to.",
"type": [
"string",
"null"
]
},
"add": {
"description": "Methods of the field to forward to (`name` or `name(Type, …)` as listed); empty only lists.",
"type": [
"array",
"null"
],
"items": {
"type": "string"
}
},
"dry_run": {
"description": "With `add`: only return the new text (default true); false writes the file.",
"type": [
"boolean",
"null"
]
}
}
}