analyze_file
Analyzes a Java source file to return file metadata, imports, types with member counts, and compilation diagnostics in a single call.
Instructions
Comprehensive file analysis in a single call.
USAGE: analyze_file(filePath="path/to/File.java") OUTPUT: File info, imports, types with member counts, diagnostics
Combines:
File info (path, package, line count)
All imports (with static/on-demand flags)
All types with member counts
Compilation diagnostics (errors/warnings)
Use this instead of multiple calls to get_document_symbols + get_diagnostics.
Requires load_project to be called first.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filePath": "<filePath>"
},
"name": "analyze_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to source file | |
| includeMembers | No | Include full member details for each type (default false) | |
| includeDiagnostics | No | Include compilation errors/warnings (default true) |