JVM Source Lens
v1.16.0Gradle-accurate JVM classpath; fetch Java source, signatures, and class structure for agents.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_class_source Get Java source for a class
Returns the Java source of a fully-qualified class. The heaviest tool in the ladder — reach for it only when you genuinely need method bodies. Use this when: reading implementation details, understanding control flow, or confirming behavior the signature alone can't reveal. Do NOT use it to discover method names (use get_class_structure) or to check signatures (use get_method_signature). Always prefer an excerpt over full source: • methodNames — array of method names to extract. Use "<init>" for constructors. Response echoes matchedMethodNames and unmatchedMethodNames. Unmatched name…
| Parameter | Type | Description |
|---|---|---|
className * | string | |
projectRoot * | string | |
configuration | string | |
endLine | integer | |
forceRefresh | boolean | |
full | boolean | |
includeTest | boolean | |
methodName | string | |
methodNames | array | |
modulePath | string | |
startLine | integer |
find_in_class_source Find text in resolved Java source
Default query is a literal substring; set regex: true only for a JavaScript RegExp. Searches the source of one resolved class — like grep, scoped to a single classpath-resolved class, not the workspace. Use this when: the class is known and you need to locate a specific string, identifier, or pattern inside it. For discovering classes by name, use search_classes; for grepping a whole dependency JAR, use search_in_artifact. Resolves source the same way as get_class_source (sources JAR preferred; CFR decompilation if absent). Returns hits with line/column, matched text, optional multiline b…
| Parameter | Type | Description |
|---|---|---|
className * | string | |
projectRoot * | string | |
query * | string | |
configuration | string | |
contextLines | integer | |
forceRefresh | boolean | |
full | boolean | |
include | array | |
includeTest | boolean | |
maxHits | integer | |
modulePath | string | |
regex | boolean |
resolve_dependencies Resolve Gradle dependencies
Runs (or returns cached) Gradle dependency resolution for the project and reports modules, configurations, and resolved artifacts. Use this when: diagnosing a version mismatch, debugging NoSuchMethodError / AbstractMethodError / ClassCastException across libraries, or confirming which version of a dependency is actually on the classpath. Start here before chasing symptoms in source. Params: standard project params; forceRefresh=true bypasses the hash cache — use it after dependency changes that don't touch build files (e.g., SNAPSHOT republish). Returns: compact text module/configuration…
| Parameter | Type | Description |
|---|---|---|
projectRoot * | string | |
forceRefresh | boolean | |
full | boolean | |
include | array |
search_classes Search classes on the resolved classpath
Discovery tool for finding classes when you don't know the FQN. Returns a ranked suggestion list: each hit is className (FQN) plus libName (artifact or Gradle module) — enough to call get_class_structure next. Use this when: the user mentions a type by simple name, you see an unknown class in a stack trace, or you need to locate which dependency provides something. Follow up with get_class_structure (scope=overview) — never jump straight to get_class_source. Query: case-insensitive substring matched against FQN, simple name, and (when sources were available at index time) declared method…
| Parameter | Type | Description |
|---|---|---|
projectRoot * | string | |
query * | string | |
configuration | string | |
forceRefresh | boolean | |
full | boolean | |
include | array | |
includeTest | boolean | |
limit | integer | |
modulePath | string |
get_method_signature Get Java method overload signatures
Lists every overload of a named method on a class. Preferred over get_class_source whenever you only need signatures. Use this when: verifying a method exists, checking parameter types, picking the right overload, or confirming a return type. For constructors, pass methodName = "<init>". Params: className; methodName (required singular) OR methodNames with exactly one element (alias — do not pass multiple names; call once per method or use get_class_structure). Standard project params. Resolution strategy (default, bytecodeOnly=false): 1. Parse .java from the sources JAR or inter-projec…
| Parameter | Type | Description |
|---|---|---|
className * | string | |
projectRoot * | string | |
bytecodeOnly | boolean | |
configuration | string | |
forceRefresh | boolean | |
full | boolean | |
include | array | |
includeTest | boolean | |
methodName | string | |
methodNames | array | |
modulePath | string |
get_class_structure Get structured Java class API
Returns the API surface of a class: purpose, declared methods, optionally fields/annotations/hierarchy. The right starting point after search_classes and before fetching source. Use this when: you have an FQN and want to know what the class does and what methods it exposes. For a single method's overloads, use get_method_signature instead. Scope (default = overview): • overview — class purpose + declared method names. When the type is field-heavy (≥8 fields and ≤2 non-constructor declared methods), lists fields (capped) instead of only a count. • declared — signature line…
| Parameter | Type | Description |
|---|---|---|
className * | string | |
projectRoot * | string | |
configuration | string | |
forceRefresh | boolean | |
full | boolean | |
include | array | |
includeTest | boolean | |
modulePath | string | |
scope | string |
search_in_artifact Search text across all classes in one resolved dependency JAR
Grep-like search across every class in one artifact (by Maven coordinates or absolute jarPath). Fetches source for each class (sources JAR preferred; CFR decompilation fallback) and runs the query, returning hits grouped by className. Use this when: you know which library contains a log message, exception string, or API literal — but not which class. Use find_in_class_source when the class is already known; use search_classes when you need to discover which library provides a class by name. Artifact selector (one required): • coordinates — { group, name, version? }. Omitting version…
| Parameter | Type | Description |
|---|---|---|
projectRoot * | string | |
query * | string | |
configuration | string | |
contextLines | integer | |
coordinates | object | |
forceRefresh | boolean | |
full | boolean | |
includeTest | boolean | |
jarPath | string | |
maxClasses | integer | |
maxHits | integer | |
modulePath | string | |
regex | boolean |