Skip to main content
Glama

find_possible_bugs

Detect potential bugs and code quality issues in Java projects, including null pointer risks, resource leaks, and synchronization problems, to improve code reliability.

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
severityNoFilter by severity: high, medium, low, all (default: all)
filePathNoOptional: specific file to check (default: all files)
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does well by listing specific detection capabilities (null pointers, resource leaks, etc.) and stating the prerequisite. However, it doesn't mention performance characteristics, rate limits, whether this is a read-only operation, or what happens if load_project hasn't been called. The behavioral context is adequate but not comprehensive.

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 clear sections (purpose, usage examples, output, detection capabilities, prerequisite). It's appropriately sized for a tool with this functionality. Every sentence earns its place, though the 'Detects:' section could be slightly more concise.

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?

Given the tool's complexity (code analysis with multiple detection types), no annotations, and no output schema, the description provides reasonable coverage. It explains what the tool does, gives usage examples, lists detection capabilities, and states a prerequisite. However, it doesn't describe the output format beyond 'List of potential issues' or explain how results are structured, which would be helpful given the absence of an output schema.

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 fully documents both parameters (severity and filePath). The description mentions filePath in a usage example but doesn't add semantic meaning beyond what the schema provides. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 the tool's purpose: 'Find possible bugs and code quality issues' with specific examples of what it detects (null pointer risks, resource leaks, etc.). This is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'get_diagnostics' or 'find_naming_violations' which might have overlapping functionality.

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?

The description provides clear usage context: 'Requires load_project to be called first' establishes a prerequisite. It also shows two usage examples with different parameter patterns. However, it doesn't explicitly state when to use this tool versus alternatives like 'get_diagnostics' or other analysis tools in the sibling list.

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