Skip to main content
Glama

get_diagnostics

Retrieve compilation errors and warnings for Java files. Filter by file, severity, and limit results to identify syntax errors, type mismatches, or 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
maxResultsNoMax diagnostics to return (default 100)
filePathNoOptional path to source file. If omitted, checks all files.
severityNoFilter by severity: 'error', 'warning', or 'all' (default: 'all')
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses the operation is read-only, returns a list of diagnostics with locations, and depends on prior project loading. Doesn't mention performance or side effects, but covers key behavioral traits.

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

Conciseness5/5

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

Description is concise (4 sentences) and front-loaded with the main purpose. Usage, output, and prerequisite are clearly separated. Every sentence adds value with no fluff.

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 no output schema, the description adequately explains the output (list of errors/warnings with locations) and includes a prerequisite. Could mention default behavior for maxResults or sorting, but still mostly complete.

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?

Input schema has 100% description coverage for all 3 parameters (maxResults, filePath, severity). The description doesn't add significant new meaning beyond what the schema already provides, so baseline 3 is appropriate.

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 'Get compilation diagnostics (errors and warnings) for a file or project.' It uses specific verb and resource, and distinguishes from sibling tools focused on analysis, code changes, or navigation.

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

Usage Guidelines4/5

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

Provides usage examples ('get_diagnostics() for all files' and 'get_diagnostics(filePath=...) for one file'), context ('Useful for finding syntax errors...'), and a prerequisite ('Requires load_project to be called first'). Does not explicitly list when not to use or alternatives, but the context is sufficient.

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