Skip to main content
Glama

find_possible_bugs

Analyzes Java source files to detect null pointer risks, resource leaks, empty catch blocks, object comparison issues, and synchronization problems.

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)
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the types of issues detected and the prerequisite, but does not mention side effects, permissions, or performance implications. It implies a read-only operation but doesn't state it explicitly.

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-organized with usage examples, output hint, and a bulleted list. It is concise (no filler) and front-loads the purpose. Minor redundancy (repeating 'USAGE') is acceptable for clarity.

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 static analysis tool with no output schema, the description gives a good overview of capabilities and a key prerequisite. It could detail the output format more, but the list of detected issues provides sufficient context for an AI agent.

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 has 100% coverage for both parameters (filePath, severity). The description adds the usage example for filePath and clarifies it's optional, but does not elaborate on severity or any format constraints. The schema already does most of the work.

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 finds bugs and code quality issues, listing specific detection types (null pointer risks, resource leaks, etc.). This distinguishes it from sibling tools like 'find_naming_violations' or 'analyze_control_flow' which target different aspects.

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?

It provides usage examples and a prerequisite ('Requires load_project to be called first'). However, it does not explicitly guide when to use this tool over alternatives (e.g., 'analyze_file') or when not to use it. The guidance is minimal but functional.

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