Skip to main content
Glama

get_diagnostics

Identify Java compilation errors and warnings in files or projects to resolve syntax issues, type mismatches, and missing imports.

Instructions

Get compilation diagnostics (errors and warnings) for a file or project.

USAGE: get_diagnostics() for all files, or get_diagnostics(filePath="...") for one file OUTPUT: List of compilation errors and warnings with locations

Useful for finding syntax errors, type mismatches, missing imports, etc.

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathNoOptional path to source file. If omitted, checks all files.
maxResultsNoMax diagnostics to return (default 100)
severityNoFilter by severity: 'error', 'warning', or 'all' (default: 'all')
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it returns a list of diagnostics with locations, explains the output format, and mentions the prerequisite ('Requires load_project to be called first'), covering key operational aspects without contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, usage, output, utility, prerequisite) and is appropriately sized. However, the USAGE section could be more concise by integrating with the purpose statement, and some redundancy exists (e.g., repeating file/project scope).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no output schema, no annotations), the description is largely complete: it explains purpose, usage, output, and prerequisites. However, it lacks details on error handling, performance implications, or how diagnostics are generated, which could be useful for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by briefly mentioning the filePath parameter usage in the USAGE section, but does not provide additional semantic context or examples for parameters like maxResults or severity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Get compilation diagnostics') and resources ('for a file or project'), distinguishing it from sibling tools like 'validate_syntax' or 'find_possible_bugs' by focusing on compilation-level errors and warnings rather than validation or bug detection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides usage guidelines: it specifies when to use the tool ('Useful for finding syntax errors, type mismatches, missing imports, etc.'), includes prerequisites ('Requires load_project to be called first'), and offers alternatives via parameter usage (e.g., all files vs. one file), though it does not name specific sibling alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pzalutski-pixel/javalens-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server