Move Symbol
moveSymbolMove top-level declarations like functions, classes, types, or constants to another file with automatic import rewiring across the project.
Instructions
Move top-level declarations (functions, classes, types, constants) to another file. Automatically rewires all imports across the project. If the target file does not exist, tsserver creates it.
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": {
"file": "<file>",
"startLine": "<startLine>",
"startOffset": "<startOffset>",
"endLine": "<endLine>",
"endOffset": "<endOffset>",
"targetFile": "<targetFile>",
"preview": "<preview>"
},
"name": "moveSymbol"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | File path (absolute or relative to cwd) | |
| endLine | Yes | 1-based end line | |
| preview | Yes | If true, only preview changes | |
| endOffset | Yes | 1-based end character offset | |
| startLine | Yes | 1-based start line | |
| targetFile | Yes | Destination file path (absolute or relative to cwd) | |
| startOffset | Yes | 1-based start character offset |