Skip to main content
Glama

get_diagnostics

Identify and diagnose compilation errors and warnings in Java files. Filter by severity and limit results for targeted debugging.

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.
severityNoFilter by severity: 'error', 'warning', or 'all' (default: 'all')
maxResultsNoMax diagnostics to return (default 100)
Behavior4/5

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

Although no annotations are provided, the description implies a read-only operation by stating 'Get compilation diagnostics'. It adds important behavioral context: the need for prior load_project, and the output as a list of errors/warnings with locations. No mention of side effects or performance, but sufficient for a diagnostic tool.

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?

The description is concise and well-structured: a one-line purpose, followed by usage examples, output description, use cases, and a prerequisite. Every sentence adds value without redundancy.

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?

The description adequately covers the tool's purpose, usage, and prerequisites. It lacks details on the exact format of returned diagnostics or pagination, but given the schema provides maxResults and no output schema exists, it is sufficiently complete for an agent to use correctly.

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

Parameters4/5

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

The input schema already covers all three parameters with descriptions. The description adds value by showing example usage patterns and clarifying the optional nature of filePath. The severity and maxResults parameters are not elaborated in the description, but the schema handles them sufficiently.

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 retrieves compilation diagnostics (errors and warnings) for a file or project, using a specific verb and resource. It distinguishes itself from sibling analysis tools by focusing on errors and warnings.

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?

The description provides explicit usage patterns: get_diagnostics() for all files or with a filePath parameter for a specific file. It also mentions the prerequisite of calling load_project first, giving clear context for when to use the tool.

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