Skip to main content
Glama

extract_superclass

Extract a new superclass by moving a selected member to a parent class, updating the source class to extend it.

Instructions

Extract a new superclass from a class: the member at the position moves up into a newly created superclass, and the class extends it.

USAGE: Position on the member to extract; provide the new superclass name. OUTPUT: createdFiles carries the new superclass file content; editsByFile carries the source class's edits. Nothing is written - create the file and apply the edits yourself.

IMPORTANT: Uses ZERO-BASED coordinates.

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to source file containing the member
lineYesZero-based line number of the member declaration
columnYesZero-based column number (on the member name)
superclassNameYesName for the new superclass
Behavior5/5

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

With no annotations provided, the description fully carries the burden of disclosure. It explicitly states that the tool does not write anything ('Nothing is written - create the file and apply the edits yourself'), which is critical for an AI agent to understand the side-effect-free nature of the operation. It also details the output format.

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 only two short paragraphs. The first sentence immediately states the purpose, followed by a usage summary and important notes. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (4 required parameters, no output schema, no annotations), the description covers all necessary contextual information: purpose, usage, coordinate convention, output format, and prerequisite ('Requires load_project'). The agent has enough context to invoke the tool correctly.

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 already provides 100% coverage with descriptions for each parameter. The description reinforces the zero-based coordinates but adds no new semantic meaning beyond the schema. Baseline is 3, and the description does not earn a higher score because it restates rather than enriches.

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 uses a specific verb ('Extract') and clearly identifies the resource ('new superclass from a class') and the action (moving a member up). It distinguishes from siblings like 'extract_interface', 'extract_method', and 'pull_up' by specifying the creation of a superclass with a member moved up.

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: 'Position on the member to extract; provide the new superclass name.' It also includes important preconditions ('Requires load_project to be called first') and coordinate convention. However, it does not explicitly state when not to use this tool or contrast with similar extraction tools among the many siblings.

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