java-lsp-tools
Skill199 starsChanged 4 months agoMITView on GitHub
Java LSP navigation, source-range handoff and troubleshooting for type lookup and file outlines.
In this repository2 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- uitestSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
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 …
- Distinctive: line 21
Prefer this tool for type-name lookup.
- Very specific: line 26
Only file: documents within the workspace are supported.
- Very specific: line 48
If lsp_java_findSymbol returns a relevant result with outlineSupported=true and implementation is needed, pass documentUri to …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

