Skip to main content
Glama
egn88

Refactor MCP

by egn88

java_change_method_signature

Change a Java method or record constructor signature by adding, removing, or reordering parameters in one refactoring. Automatically updates record declarations and call sites.

Instructions

Change a Java method or record constructor signature with multiple parameter operations (add, remove, reorder) in a single refactoring. More efficient than calling individual tools when making multiple changes. 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 (adding null for new parameters).

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
parametersToAddNoParameters to add to the method
newParameterOrderNoFinal parameter order by name. Applied after additions and removals.
existingParameterTypesNoExisting parameter types to match specific overload
parameterIndicesToRemoveNoIndices of parameters to remove (0-indexed, from original signature). Processed before additions.
Behavior3/5

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

With no annotations provided, the description must fully disclose behavior. It covers record auto-detection and null insertion for new parameters, but omits error handling, side effects on callers, or requirements like project compilability. Adequate but not thorough.

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 concise, covering the main points in two sentences. It is front-loaded with the core purpose. Minor improvement could be made by structuring with bullet points for clarity, but overall efficient.

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 tool's complexity (9 parameters, record handling, multiple operations), the description covers the main use case but lacks details on error scenarios, project prerequisites, and potential compilation impacts. It is adequate but not fully comprehensive.

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?

Since schema coverage is 100%, the baseline is 3. The description adds value by explaining the order of operations (removals before additions), record-specific methodName usage, and the purpose of multiple operations, enhancing understanding 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 tool changes method/record constructor signatures with multiple operations, and it distinguishes itself from siblings by emphasizing efficiency over individual tools. It also specifies record handling and method naming.

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 explains when to use this tool (multiple changes) and provides record-specific usage. However, it does not explicitly state when to use individual sibling tools instead, leaving the agent to infer alternatives.

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