get_quick_fixes
Lists available quick fixes for a Java problem at a specific file position, covering import suggestions, unused imports, and exception handling.
Instructions
List available fixes for a problem at position.
USAGE: get_quick_fixes(filePath="...", line=10) OUTPUT: List of quick fixes with fixId, label, and category
Supported fixes:
UndefinedType: Suggest imports for unresolved types, each fixId naming the type as an import does (add_import:pkg.Outer.Inner for a member type); a type in the default package, or in a package its module does not export to the project (such as the JDK's internal packages), cannot be imported and is never suggested; the package's name never decides. Every candidate is ranked by relevance (equally relevant ones by name), then the 10 most relevant are listed
UnusedImport: Remove unused import
UnhandledException: Add throws or surround with try-catch
Fixes are listed by relevance. meta.totalCount counts every fix for the problems at the position, meta.returnedCount those listed, and meta.truncated is true when import candidates are left out.
IMPORTANT: Uses ZERO-BASED line numbers.
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>",
"line": "<line>"
},
"name": "get_quick_fixes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Zero-based line number | |
| column | No | Zero-based column number (optional, uses whole line if omitted) | |
| filePath | Yes | Path to source file |