Skip to main content
Glama

get_quick_fixes

Lists available quick fixes for a Java problem at a specific file position, covering import suggestions, unused imports, and exception handling.

Instructions

List available fixes for a problem at position.

USAGE: get_quick_fixes(filePath="...", line=10) OUTPUT: List of quick fixes with fixId, label, and category

Supported fixes:

  • UndefinedType: Suggest imports for unresolved types, each fixId naming the type as an import does (add_import:pkg.Outer.Inner for a member type); a type in the default package, or in a package its module does not export to the project (such as the JDK's internal packages), cannot be imported and is never suggested; the package's name never decides. Every candidate is ranked by relevance (equally relevant ones by name), then the 10 most relevant are listed

  • UnusedImport: Remove unused import

  • UnhandledException: Add throws or surround with try-catch

Fixes are listed by relevance. meta.totalCount counts every fix for the problems at the position, meta.returnedCount those listed, and meta.truncated is true when import candidates are left out.

IMPORTANT: Uses ZERO-BASED line numbers.

Requires load_project to be called first.

Input Schema

NameRequiredDescriptionDefault
lineYesZero-based line number
columnNoZero-based column number (optional, uses whole line if omitted)
filePathYesPath to source file

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.4
  2. Removedv1.3.3
  3. First observedv1.2.0

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations to lean on, the description carries the full burden and does so: it discloses the ranking/selection behavior ('ranked by relevance ... then the 10 most relevant are listed'), the truncation semantics of meta.totalCount/returnedCount/truncated, the zero-based line convention, and the non-obvious import constraint that non-exported packages are never suggested. These are behavioral traits an agent could not recover from the schema.

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?

Well front-loaded: purpose, then USAGE, OUTPUT, supported fixes, and truncation semantics in descending priority. A few sentences are dense and slightly convoluted (the UndefinedType bullet), but every block contributes information the agent needs.

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?

There is no output schema, and the description compensates by naming the return shape (fixId, label, category) plus the meta counters and truncation flag. Combined with the prerequisite and line-numbering warning, nothing material is missing for correct invocation.

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%, so the schema already documents filePath, line, and column, including the zero-based convention that the description repeats in caps. The 'uses whole line if omitted' behavior for column is also in the schema, so the description adds no real parameter meaning beyond the structured data.

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

Purpose4/5

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

States a specific verb and resource ('List available fixes for a problem at position') and enumerates the concrete fix categories it can return. It never names the adjacent tool apply_quick_fix, so the read-vs-apply distinction from siblings is left to be inferred from the OUTPUT line rather than stated.

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?

Gives a concrete invocation example and a hard prerequisite ('Requires load_project to be called first'), which is exactly the context an agent needs before calling. It does not state when NOT to use it or explicitly route to apply_quick_fix, so it stops short of full alternative routing.

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