Skip to main content
Glama

find_possible_bugs

Detect null pointer risks, resource leaks, empty catch blocks, and synchronization issues in Java code. Optionally filter by file or severity.

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 provided, the description carries full burden. It lists detected issues and indicates a list output, but does not disclose side effects, destructiveness, authentication needs, rate limits, or performance characteristics. Essential behavioral traits are missing.

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 front-loaded with the purpose, followed by usage examples, output type, list of issues, and prerequisite. It is concise with no wasted sentences, though usage examples are slightly redundant.

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

Completeness3/5

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

The description covers purpose, usage, output type, detection types, and prerequisite. However, it lacks details on the structure of the output list (e.g., location, message for each issue) and does not explain severity filtering beyond the schema. With two optional parameters and no output schema, it is moderately complete.

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?

The input schema covers both parameters (filePath, severity) with descriptions (100% coverage). The tool description adds no extra meaning beyond the schema; it only shows usage for one parameter. Baseline is 3 as schema already provides adequate semantics.

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 'Find possible bugs and code quality issues' and provides a detailed list of specific detection types (null pointer risks, resource leaks, etc.). However, it does not explicitly differentiate from sibling tools like 'analyze_file' or 'find_unused_code', which may also detect some issues.

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

Usage Guidelines2/5

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

The description includes a prerequisite ('Requires load_project to be called first') and usage examples, but it lacks any guidance on when to use this tool versus alternatives. No exclusions or context for selection among sibling tools are provided.

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