Skip to main content
Glama

push_down

Moves a method or field from a superclass into its direct subclasses and removes it from the superclass. Position on the member name to generate per-file edits.

Instructions

Push a method or field down into the declaring class's subclasses and remove it from the declaring class.

USAGE: Position on the member name in the superclass. OUTPUT: editsByFile covering the superclass (member removed) and each subclass (member added); warnings from JDT's condition checking, by the place each names (file, then position; those naming one place in JDT's order, those naming none last). Edits are returned as text - apply them yourself.

The direct subclasses are those of the Java model, local and anonymous classes in and after lambda bodies included. A member whose class has an anonymous direct subclass is refused, naming each anonymous subclass: push down cannot add a member to an anonymous class. A member whose class has a direct subclass that JDT's own type hierarchy leaves out (a class declared in a lambda body, a local class read by the handle of another of the same name) is refused, naming each such subclass: JDT's push down would not write the member into it.

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.1

TDQS

A4.6/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 burden and does so richly: it discloses the output shape (editsByFile per superclass/subclass, warnings ordering), that edits are returned as text and must be applied manually, and the precise refusal conditions (anonymous direct subclasses, JDT-hierarchy-omitted subclasses) with the reasons. This is exactly the behavioral context a mutation tool needs.

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?

Front-loads purpose, then USAGE/OUTPUT/refusals in scannable blocks; nearly every sentence earns its place by conveying a distinct constraint. Slightly verbose in the refusal explanations and the trailing IMPORTANT restates the schema's zero-based note, keeping it out of 5 territory.

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?

No output schema exists, and the description fully covers the return shape, ordering, refusal behavior, and prerequisite; for a refactoring tool with no annotations this is complete enough for an agent to call it correctly and interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so line/column/filePath are already documented, giving a baseline of 3. The description adds semantic meaning beyond the schema: coordinates must sit on the member NAME, the target is the declaration in the superclass, and it emphasizes the zero-based convention that the schema only mentions in passing.

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?

States a specific verb+resource ('Push a method or field down into the declaring class's subclasses and remove it from the declaring class') and the inverse relationship makes it easily distinguishable from the sibling pull_up. An agent can identify the operation without opening the schema.

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?

Gives a clear precondition ('Requires load_project to be called first') and placement instruction ('Position on the member name in the superclass'), plus explicit refusal cases that tell the agent when the tool will not work. It does not, however, explicitly contrast with alternatives like pull_up or move_type_to_new_file when the user's intent is ambiguous.

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