Skip to main content
Glama

suggest_imports

Finds import candidates for unresolved Java types by searching project sources, JDK, and libraries, returning results sorted by relevance.

Instructions

Find import candidates for unresolved type.

USAGE: suggest_imports(typeName="List") OUTPUT: List of matching types with fully qualified names and relevance

Searches project sources, JDK, and libraries for types matching the simple name. Results are sorted by relevance (java.util types ranked higher than java.awt, etc.).

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNameYesSimple type name to find imports for (e.g., 'List', 'Map')
maxResultsNoMaximum candidates to return (default 20)
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that the tool searches project sources, JDK, and libraries, and sorts results by relevance with explicit ranking (e.g., java.util higher than java.awt). It also describes the output format, which is adequate for a read-only query tool.

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 extremely concise, with a clear structure: purpose, usage example, output summary, and behavior details. Every sentence adds value without 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?

Given no output schema and no annotations, the description covers purpose, prerequisites, search scope, sorting behavior, and output format. It lacks details on error handling or edge cases, but for a simple suggestion tool, it is sufficiently 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?

All parameters are described in the input schema (100% coverage). The description adds a usage example for the required typeName parameter but does not provide additional semantics for maxResults (e.g., default value is in schema only). Thus, no significant value beyond 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?

Description clearly states 'Find import candidates for unresolved type' and provides a usage example. It explains what sources are searched (project, JDK, libraries), which differentiates it from generic search tools, but doesn't explicitly contrast with siblings like search_symbols or organize_imports.

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 includes a prerequisite ('Requires load_project to be called first') and a usage example, which provides context. However, it does not specify when to use this tool over alternatives like get_quick_fixes or search_symbols, leaving the agent to infer the best use case.

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