Skip to main content
Glama

extract_interface

Extract a Java interface from a class by providing the interface name and optionally selecting public methods. Receives zero-based coordinates and returns the interface content plus class edits to add implements clause.

Instructions

Extract an interface from a class containing selected public methods.

Returns the text for a new interface file and edits to add 'implements' clause to the original class.

USAGE: Position on class, provide interface name, optionally specify methods OUTPUT: Interface file content and class modification edit

IMPORTANT: Uses ZERO-BASED coordinates.

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to source file containing the class
lineYesZero-based line number of class declaration
columnYesZero-based column number
interfaceNameYesName for the new interface
methodNamesNoSpecific method names to include (default: all public non-static methods)
Behavior3/5

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

No annotations are provided, so the description must cover behavioral traits. It discloses zero-based coordinates and that the output includes interface file content and class modification. However, it does not explicitly state that the tool modifies files (creates new interface and edits class), which is important side-effect information.

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 relatively concise and structured with clear sections (USAGE, OUTPUT, IMPORTANT). It is not verbose, though it could be slightly more streamlined.

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 the tool has 5 parameters, high schema coverage, and no output schema, the description provides necessary context: prerequisite (load_project), coordinate system, usage pattern, and output type. It is fairly complete for an agent to understand usage.

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 coverage is 100%, so the schema already documents all parameters. The description adds minimal extra meaning beyond the schema, such as emphasizing zero-based coordinates. Baseline of 3 is appropriate.

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's purpose: extract an interface from a class containing selected public methods. It uses specific verbs and resources, and it stands out among sibling tools which are mostly analysis or different refactoring operations.

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 usage instructions: position on class, provide interface name, optionally specify methods. It also notes the prerequisite of calling load_project. However, it does not explicitly exclude use cases or compare to alternatives like extract_method.

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