| name | java-lsp-tools |
| description | Compiler-accurate Java symbol navigation via the Java Language Server. Use lsp_java_findSymbol for Java identifiers and lsp_java_getFileStructure for known Java files; prefer them over generic search only for symbol/file-outline navigation. |
Java LSP Tools
Two compiler-accurate tools backed by the Java Language Server (jdtls). They return structured JSON that is easier to interpret than generic search results for Java symbol navigation.
Tools
lsp_java_findSymbol
Search for Java symbol definitions (classes, methods, fields) by name across the workspace. Supports partial matching.
- Input:
{ query, limit? } — limit defaults to 20, max 50
- Output:
{ results: [{ name, kind, container?, file, startLine, endLine, readFileInput, range }], total }; readFileInput is { filePath, offset, limit } for read_file, and file can be passed to lsp_java_getFileStructure
- Use instead of
grep_search, file_search, semantic_search, or search_subagent when looking for where a Java class/method/field is defined by identifier
- When source is needed for a returned symbol, use its
readFileInput directly
lsp_java_getFileStructure
Get hierarchical outline of a Java file (classes, methods, fields) with line ranges.
- Input:
{ uri, limit? } — workspace-relative path plus max outline items. Prefer file from lsp_java_findSymbol; limit defaults to 20, max 60. Must be a known path from prior tool results or user input — do not guess
- Output: ; call with and the selected symbol's