Skip to main content
Glama
egn88

Refactor MCP

by egn88

java_remove_parameter

Remove a parameter from a Java method or record constructor, automatically updating all call sites in the project.

Instructions

Remove a parameter from a Java method or record constructor and update all call sites. For Java records, use methodName "" or the class name - the tool auto-detects records and updates both the record declaration AND all "new RecordName(...)" call sites.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dryRunNoPreview changes without applying (default: true)
classNameYesFully qualified class name containing the method or record
methodNameYesMethod name. For record constructors, use "<init>" or the class name (e.g., "MyRecord")
javaVersionNoJava version to use (e.g., "17.0.16-amzn", "21.0.8-tem")
projectPathYesPath to the Java project root
parameterIndexYesIndex of parameter to remove (0-indexed)
existingParameterTypesNoExisting parameter types to match specific overload
Behavior4/5

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

The description discloses key behaviors: updating all call sites, auto-detecting records, and updating both declaration and 'new' call sites. Since no annotations are provided, the description carries the full burden; it covers important aspects but omits details on method body updates, permissions, or side effects.

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 two sentences, each earning its place: the first states the core action, the second gives specific record handling. No unnecessary words, efficient and clear.

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

Completeness3/5

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

Given the complexity of the tool (removing a parameter and updating call sites), the description lacks detail on return values or confirmation output. No output schema exists, so the description should compensate, but it does not describe what the tool returns or any summary of changes.

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?

The schema has 100% coverage, but the description adds value by explaining that methodName can be '<init>' or class name for records, and that parameterIndex is 0-indexed (though schema also states this). It provides additional context 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 clearly states the action 'Remove a parameter' and the scope 'from a Java method or record constructor and update all call sites.' It uses specific verbs and resources, and differentiates from sibling tools like java_add_parameter and java_reorder_parameters.

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 clear context for record constructors, instructing on methodName usage and auto-detection. However, it does not explicitly compare with other sibling tools (e.g., java_change_method_signature) or state when not to use this tool.

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/egn88/refactor-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server