Skip to main content
Glama

find_possible_bugs

Identify null pointer risks, resource leaks, empty catch blocks, object comparison errors, and synchronization issues in Java code. Optionally filter by severity or target a specific file.

Instructions

Find possible bugs and code quality issues.

USAGE: find_possible_bugs() USAGE: find_possible_bugs(filePath="path/to/File.java") OUTPUT: List of potential issues

Detects:

  • Null pointer risks (dereferencing potentially null values)

  • Resource leaks (unclosed streams, connections)

  • Empty catch blocks

  • Comparison issues (== on objects instead of equals)

  • Synchronization issues (sync on String)

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathNoOptional: specific file to check (default: all files)
severityNoFilter by severity: high, medium, low, all (default: all)
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It lists what it detects but does not mention whether the operation is read-only, any side effects, or how it handles errors. The prerequisite is noted, but the impact on the system is unclear.

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?

The description is well-structured with usage sections and bulleted examples. Every part adds value, though the list of detections could be slightly more concise.

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?

For a tool with 2 parameters and no output schema, the description adequately covers prerequisites, usage, and examples of findings. It is complete enough for an agent to understand when and how to invoke it, although it could mention the output format.

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 coverage is 100%, so both parameters are already documented. The description adds usage examples and clarifies defaults (all files, all severity), but does not add substantial meaning beyond the schema.

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?

The description clearly states it finds bugs and code quality issues, listing specific examples like null pointer risks and resource leaks. It distinguishes from siblings by focusing on bugs rather than other code properties.

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

Usage Guidelines3/5

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

The description provides usage patterns and explicitly requires load_project to be called first. However, it lacks guidance on when not to use this tool versus alternatives like find_unused_code, and does not mention any conditions or exclusions.

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