Skip to main content
Glama

extract_superclass

Move a class member into a new superclass and update the original class to extend it. Provide the superclass name and zero-based coordinates.

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; warnings, present only when there is one, JDT's findings from its condition checking, by the place each names (file, then position; those naming one place in JDT's order, those naming none last). 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

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.1

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral disclosure: it explains that nothing is written and the caller must create the file and apply edits, details the output fields (createdFiles, editsByFile, warnings), and gives formatting rules for warnings. This is exactly the kind of side-effect and result-shape information an agent needs beyond structured fields.

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 front-loaded with its core purpose and uses clear USAGE/OUTPUT/IMPORTANT sections. However, the warnings-ordering sentence is dense and awkwardly phrased ('by the place each names... those naming one place in JDT's order, those naming none last'), which slightly reduces readability.

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 absence of annotations and an output schema, the description is complete enough: it covers prerequisites, invocation, coordinate system, output structure, and side effects. An agent has everything needed to call and interpret 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?

Schema description coverage is 100%, so the input schema already documents all four parameters, including zero-based coordinates. The description adds only minor emphasis ('Position on the member to extract', 'provide the new superclass name') and repeats the zero-based warning already present in the schema, so it does not add much semantic value beyond the schema.

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 states a precise verb and resource: 'Extract a new superclass from a class', and describes the transformation (member moves up, class extends new superclass). This clearly differentiates it from sibling refactorings like extract_method, pull_up, and extract_interface.

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?

It gives concrete invocation guidance: 'Position on the member to extract; provide the new superclass name', and states a prerequisite ('Requires load_project to be called first'). It does not, however, say when to prefer this tool over alternatives or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.