rename_symbol
MCP tools › Code insight and refactoring
Rename the symbol at a position of a workspace file in all its usages, through the file's language server. Optional renames in comments, strings and text files are listed as numbered occurrences (exclude skips some). Usages outside the project's own sources (virtual environments, dependencies, build output, ignored files) are listed as numbered outside_project and changed only via include_outside. Dry run by default: returns edits per file; dry_run=false writes, refusing if any file changed. A Java type renamed in its own file renames the file (renamed_files; undo with undo_refactoring). CSS classes and ids are renamed by Ferris IDEA itself across stylesheets and HTML.
Its results carry text from files, language_server: the client is told to treat that as data, never as instructions.
| Capability | code.rename_symbol |
|---|---|
| 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 file path. |
linerequired | integer | 0-based line.minimum 0 |
characterrequired | integer | 0-based character in the line (Unicode scalar values).minimum 0 |
new_namerequired | string | New name. |
search_comments_and_strings | boolean | Also rename the old name as a whole word in comments and string literals (SPEC-0148, default false). |
search_text_occurrences | boolean | Also rename it in text files: Markdown, XML, YAML, JSON, TOML and files without a code language (default false). |
exclude | array of integer | Indexes into occurrences of the dry run to leave unchanged. |
include_outside | array of integer | Indexes into outside_project of the dry run to change too: code usages in files that
are not the project's own sources (a virtual environment, installed dependencies, build
output, excluded or ignored files). None by default (SPEC-0148 v3 behaviour 7). |
dry_run | boolean | Only 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.
ferris-idea call ~/my-project rename_symbol '{"path":"<string>","line":1,"character":1,"new_name":"<string>"}'Input schema as JSON
{ "type": "object", "required": [ "path", "line", "character", "new_name" ], "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 }, "new_name": { "description": "New name.", "type": "string" }, "search_comments_and_strings": { "description": "Also rename the old name as a whole word in comments and string literals (SPEC-0148,\ndefault false).", "type": [ "boolean", "null" ] }, "search_text_occurrences": { "description": "Also rename it in text files: Markdown, XML, YAML, JSON, TOML and files without a code\nlanguage (default false).", "type": [ "boolean", "null" ] }, "exclude": { "description": "Indexes into `occurrences` of the dry run to leave unchanged.", "type": [ "array", "null" ], "items": { "type": "integer", "minimum": 0 } }, "include_outside": { "description": "Indexes into `outside_project` of the dry run to change too: code usages in files that\nare not the project's own sources (a virtual environment, installed dependencies, build\noutput, excluded or ignored files). None by default (SPEC-0148 v3 behaviour 7).", "type": [ "array", "null" ], "items": { "type": "integer", "minimum": 0 } }, "dry_run": { "description": "Only report the edits (default true).", "type": [ "boolean", "null" ] } }}