Organize Imports
organizeImportsSort, coalesce, and remove unused imports in TypeScript or JavaScript files. Uses TypeScript's native organizeImports to clean up import statements for files in a tsconfig.json project.
Instructions
Sort, coalesce, and remove unused imports in a TypeScript/JavaScript file. Uses TypeScript's native organizeImports with mode 'All' (sorts, coalesces, and removes unused). Requires the file to be part of a tsconfig.json project.
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>",
"preview": "<preview>"
},
"name": "organizeImports"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | File path (absolute or relative to cwd) | |
| preview | Yes | If true, only preview changes |