Skill v1.0.0
currentTrusted Publisher100/100version: "1.0.0" name: java-lsp-tools description: Java LSP navigation, source-range handoff and troubleshooting for type lookup and file outlines.
Java LSP Tools
Two navigation tools backed by language-service providers, including the Java Language Server (jdtls). Availability and results depend on imported projects, provider scope and Java settings; they do not certify complete coverage.
If these tools are not already available in the current tool list, load them with tool_search using a query such as Java LSP symbol navigation lsp_java.
Tools
lsp_java_findSymbol
Locate Java types (classes, interfaces, enums, records) by name or pattern.
- Input:
{ query, limit? }— integer limit defaults to 20, max 50; caps output only, not provider search work. - Source methods are searched only when
java.symbols.includeSourceMethodDeclarationsis enabled (off by default). Fields are not searched. Do not change user settings to make a query work. - Output:
{ results: [{ name, kind, container?, documentUri, file?, outlineSupported, unsupportedReason?, selectionRange: { startLine, endLine } }], total, truncated? }. selectionRangecontains 1-based inclusive navigation lines, usually only the name. It is not a full declaration or implementation read range.documentUripreserves the provider's exact URI.fileis an absolute path, present only for supportedfile:workspace documents.outlineSupportedmeans the location is eligible for the outline tool, not that the file exists or is readable.- Prefer this tool for type-name lookup. For a member, inspect the known containing type's file outline; if the type is unknown, use text search.
lsp_java_getFileStructure
Get hierarchical outline of a Java file (classes, methods, fields) with line ranges.
- Input:
{ uri, limit? }— prefer the exactdocumentUrifrom a result withoutlineSupported=true. Confirmed absolute or workspace-relative file paths also work. Do not guess paths. Integer limit defaults to 20, max 60, including child nodes. - Only
file:documents within the workspace are supported. The item limit caps output, not provider work. - Output:
{ documentUri, file, symbols: [{ name, kind, startLine, endLine, readFileRange, range, detail?, children? }], truncated? }.fileis absolute.readFileRangecontains a 1-basedoffsetand line-countlimitcovering the provider's full declaration range. - For a reader accepting
{ filePath, offset, limit }, usefilePath=filewith the selected symbol'sreadFileRange. Adapt to other reader schemas; Native and CLI parameters are not necessarily identical. - Select a member before reading a large class.
truncated=truemeans count or depth limits omitted symbols; it does not mean the requested member is absent. Use targeted text search when the capped outline omits it. - Use before
read_filewhen you need to choose a precise line range in a known Java file
When to Use
| Task | Use | Not | |
|---|---|---|---|
| Find a type by name | lsp_java_findSymbol | Full-file reads | |
| Find a member of a known type | Locate type, then lsp_java_getFileStructure | Blind member-name workspace search | |
| Find a member with unknown containing type | Text search | Assuming method/field search is supported | |
| See known Java file outline before reading | lsp_java_getFileStructure | read_file full file | |
| Search non-Java files (xml, gradle) | grep_search | lsp tools | |
| Search string literals or comments | grep_search | lsp tools | |
| Explore broad concepts without identifiers | semantic_search or search_subagent | lsp tools |
Typical Workflow
lsp_java_findSymbol → lsp_java_getFileStructure → read_file (specific lines only)
If lsp_java_findSymbol returns a relevant result with outlineSupported=true and implementation is needed, pass documentUri to lsp_java_getFileStructure. Select the appropriate member's full range, then read it. Do not use the workspace symbol's selectionRange as a substitute for a full implementation.
Fallback
- Empty result: normalization is retried internally only when it changes the query. Retry once after initialization if
reason=serverNotFullyReady; otherwise use text search. Initialization readiness is not index-completeness evidence. outlineSupported=false: use an authorized document reader supportingdocumentUri. Dependency, virtual, remote and outside-workspace documents are not supported by this outline tool; do not rewrite their URIs as workspace paths or bypass access boundaries.fileNotFound: confirm the file via type lookup or file search; do not guess.permissionDenied/fileSystemUnavailable: check permissions or the file system connection; symbol search does not repair these failures.ambiguousWorkspacePath: passdocumentUriinstead of a duplicated workspace-folder display name.- Other tool errors: fall back to text search and an appropriate reader; do not repeatedly retry.