Skip to content

Commit 5a217e6

Browse files
wenytang-msCopilot
andcommitted
perf: trim Java LSP tool descriptions to reduce token cost
modelDescription is sent to the model on every request, so condense both tool descriptions and the uri param description while keeping the read_file (offset/limit) handoff and no-re-search guidance intact. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 35f41d8 commit 5a217e6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
{
5353
"name": "lsp_java_getFileStructure",
5454
"toolReferenceName": "javaFileStructure",
55-
"modelDescription": "Get a known Java file's outline: classes, interfaces, methods, fields, symbol kinds, and read_file ranges, to pick a precise source range instead of reading the whole file.\n\nUse when the user gave a Java file path or lsp_java_findSymbol returned a file and broader file context is needed; do not guess paths. Results include a top-level file plus per-symbol startLine, endLine, and readFileRange ({ offset, limit }); call read_file with filePath=file and the selected symbol's readFileRange. Use limit to cap returned outline items (default 20, max 60). Not for workspace-wide search\u2014use lsp_java_findSymbol for that.",
55+
"modelDescription": "Outline a known Java file (classes, methods, fields with line ranges) to pick a precise read_file range instead of reading the whole file. Needs a path from lsp_java_findSymbol or the user — do not guess. Returns file plus per-symbol readFileRange ({ offset, limit }) for read_file. Use limit to cap outline items (default 20, max 60). Not for workspace search (use lsp_java_findSymbol).",
5656
"displayName": "Java: Get File Structure",
5757
"userDescription": "Get a Java file outline with classes, methods, fields, and line ranges.",
5858
"tags": [
@@ -69,7 +69,7 @@
6969
"properties": {
7070
"uri": {
7171
"type": "string",
72-
"description": "Workspace-relative path to a Java file. Prefer file returned by lsp_java_findSymbol. Must be a known path from prior tool results or user input — do not guess."
72+
"description": "Workspace-relative path to a Java file, from lsp_java_findSymbol or user input — do not guess."
7373
},
7474
"limit": {
7575
"type": "number",
@@ -84,7 +84,7 @@
8484
{
8585
"name": "lsp_java_findSymbol",
8686
"toolReferenceName": "javaFindSymbol",
87-
"modelDescription": "Find Java class, interface, method, or field definitions across the workspace by name or partial identifier. Prefer over grep_search, file_search, semantic_search, or search subagents for Java symbol lookup.\n\nResults include file, startLine, endLine, range, and readFileInput ({ filePath, offset, limit }) compatible with read_file. On relevant results, use read_file with readFileInput when source is needed, or lsp_java_getFileStructure with the returned file when broader file context is needed. The tool retries internally, so on an empty result do not re-search\u2014retry once only if it reports indexing in progress, otherwise use generic search.\n\nDo not use for non-Java files, literals, comments, build/XML files, or conceptual exploration.",
87+
"modelDescription": "Find Java class/interface/method/field definitions across the workspace by name or partial identifier. Prefer over grep_search, file_search, or semantic_search for Java symbol lookup. Each result has file and readFileInput ({ filePath, offset, limit }) for read_file; use it when source is needed, or lsp_java_getFileStructure with file for broader context. On empty results don't re-search (it retries internally); retry once only if it reports indexing in progress, else use generic search. Not for non-Java files, literals, comments, or build/XML files.",
8888
"displayName": "Java: Find Symbol",
8989
"userDescription": "Find Java class, method, field, or interface definitions by name.",
9090
"tags": [

0 commit comments

Comments
 (0)