organize_imports
Sort and remove unused imports in a TypeScript file. Preview changes by default, or apply them by setting apply to true.
Instructions
Sort a file's imports and drop unused ones, using TypeScript's own organizer. Previews the edits by default; pass apply to write them to disk.
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>"
},
"name": "organize_imports"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path to the file (relative to project root) | |
| apply | No | Write the changes to disk (default: false, which previews the edits). |