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.
| Capability | code.delegate_methods |
|---|---|
| Area | Code insight and refactoring |
| Access | changes files |
| Reaches | process |
| Rights | write |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
pathrequired | string | Workspace-relative .java file. |
linerequired | integer | 0-based line inside the class.minimum 0 |
characterrequired | integer | 0-based character in the line.minimum 0 |
field | string | With add: the field to forward to. |
add | array of string | Methods of the field to forward to (name or name(Type, …) as listed); empty only lists. |
dry_run | boolean | With 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.
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" ] } }}