Skip to main content
Glama

diagnose_and_fix

Diagnose a Java file and compute quick-fix edits for each fixable problem. Returns the top fix edits as editsByFile without applying them.

Instructions

Diagnose a file and compute the quick-fix edits in one call: runs diagnostics, resolves the available fixes per fixable problem, and returns the top fix's edits for each, combined as editsByFile.

USAGE: diagnose_and_fix(filePath="path/to/File.java") OUTPUT: problems (each with its chosen fix when one exists) and editsByFile with the computed edits. NOTHING is written - apply the returned edits yourself.

A file with no fixable diagnostics returns empty problems/edits.

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to source file
Behavior5/5

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

The description discloses that no changes are written ('NOTHING is written - apply the returned edits yourself'), and explains the output structure (problems, editsByFile) and behavior for files with no fixable diagnostics. No annotations are provided, so the description fully carries the transparency burden.

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 purpose sentence, a usage line, an output description, a crucial note about not writing, and a condition for empty results. Every sentence adds value without redundancy.

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

Completeness5/5

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

Given the single parameter, no output schema, and no annotations, the description fully covers the tool's input, output, behavior, and prerequisites. It explains the output format and the condition for empty results, leaving no significant gaps.

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 single parameter 'filePath' has a minimal schema description. The description adds context: it shows the usage format, confirms the file is a source file, and references the prerequisite that load_project must be called. This adds value beyond the schema alone.

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 diagnoses a file and computes quick-fix edits in one call, specifying the verb (diagnose and fix) and resource (file). It distinguishes from siblings like get_diagnostics and apply_quick_fix by combining both steps.

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 a usage example and explicitly states the prerequisite 'load_project' must be called first. It also clarifies that the tool does not write edits. However, it does not explicitly contrast with alternatives like get_quick_fixes+apply_quick_fix, leaving some ambiguity.

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