Skip to main content
Glama

get_diagnostics

Find compilation errors and warnings in Java files. Filter by severity and limit results to diagnose 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.
severityNoFilter by severity: 'error', 'warning', or 'all' (default: 'all')
maxResultsNoMax diagnostics to return (default 100)
Behavior3/5

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

No annotations provided, so description carries burden. It mentions output is a list of errors/warnings with locations and prerequisite. Does not disclose read-only nature, side effects, or permission needs.

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?

Description is concise with separate sections for usage and output, but could be slightly tighter without losing meaning. Efficient overall.

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?

No output schema provided, but description mentions return type. Covers prerequisite and parameter behavior. Lacks details on error handling or behavior with zero results, but adequate for a diagnostic tool.

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?

Schema description coverage is 100%. Description adds minimal extra meaning beyond schema (e.g., repeats filePath behavior). Does not elaborate on severity or maxResults parameters.

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?

Description clearly states it gets compilation diagnostics (errors and warnings) for a file or project. Distinguishes from sibling tools like analyze_file or find_references by focusing specifically on diagnostic information.

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 explicit usage examples (get_diagnostics() vs get_diagnostics(filePath=...)) and states the prerequisite 'Requires load_project to be called first.' However, does not explicitly compare to alternatives or state when not to use.

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