Rename / Move File or Folder
getEditsForFileRenameRenames or moves TypeScript/JavaScript files or folders and automatically updates all import paths across the project. Supports .ts, .tsx, .js, .jsx.
Instructions
Rename or move a TypeScript/JavaScript file OR folder and automatically update all import paths across the project. Supports .ts, .tsx, .js, .jsx. tsserver auto-discovers the relevant tsconfig.json. For folders, all imports referencing files inside the folder are updated.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"from": "<from>",
"to": "<to>",
"preview": "<preview>"
},
"name": "getEditsForFileRename"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | New file or folder path (absolute or relative to cwd) | |
| from | Yes | Current file or folder path (absolute or relative to cwd) | |
| preview | Yes | If true, show what would change without applying anything |