Skip to main content
Glama

find_instanceof_checks

Locate all instanceof checks for a specific type to identify type checking patterns, replace with virtual dispatch, or understand type discrimination logic.

Instructions

Find all instanceof checks for a type (x instanceof Foo).

JDT-UNIQUE: This fine-grained search is not available in LSP.

USAGE: Provide fully qualified type name OUTPUT: All locations where instanceof checks against this type occur

Useful for:

  • Identifying type checking patterns

  • Finding polymorphism opportunities (replace instanceof with virtual dispatch)

  • Understanding type discrimination logic

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNameYesFully qualified type name to find instanceof checks for
maxResultsNoMaximum results to return (default 100)
Behavior3/5

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

No annotations are provided, so the description carries full burden. It describes the tool's action (finding instanceof checks) and the prerequisite (load_project), but does not disclose whether the operation is read-only, its performance characteristics, or any side effects. The information is minimal but not misleading.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise at about 8 lines, with clear sections: main purpose, JDT uniqueness, usage, output, useful for, and prerequisite. It is front-loaded and every sentence adds value, with no redundancy.

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 simple search tool with no output schema, the description covers purpose, usage, output expectation, and prerequisite. It is fairly complete, though it could briefly mention the output format or error handling. Overall, adequate for an agent to use this tool effectively.

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?

Both parameters have schema descriptions with 100% coverage. The description repeats that typeName must be fully qualified but adds no new semantics beyond the schema. Per guidelines, baseline is 3 when schema coverage is high and description adds no extra value.

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 'Find all instanceof checks for a type (x instanceof Foo)', specifying the verb 'find', the resource 'instanceof checks', and the type parameter. It explains the unique JDT aspect and lists useful scenarios, distinguishing it from siblings like 'find_casts' and 'find_type_instantiations'.

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 explicit usage instructions: 'Provide fully qualified type name', and states the prerequisite 'Requires load_project to be called first.' It lists use cases but does not explicitly contrast with sibling tools or advise when not to use it. The JDT-UNIQUE note offers some differentiation.

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