organize_imports
Removes unused imports and sorts remaining imports alphabetically in a Java file. Returns the organized import block to replace existing imports.
Instructions
Organize imports in a Java file.
Removes unused imports and sorts remaining imports alphabetically. Returns the organized import block that should replace the existing imports.
USAGE: organize_imports(filePath="path/to/File.java") OUTPUT: Organized import statements and list of changes
Requires load_project to be called first.
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": {
"filePath": "<filePath>"
},
"name": "organize_imports"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to source file |