Skip to main content
Glama
egn88

Refactor MCP

by egn88

java_reorder_parameters

Reorder parameters in Java methods and record constructors, with automatic updating of all call sites.

Instructions

Reorder parameters in 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
newParameterOrderYesNew order of parameter names
existingParameterTypesNoExisting parameter types to match specific overload
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses that the tool updates all call sites and auto-detects records, which is helpful. However, it does not mention any potential side effects, permissions, or limitations, such as whether the refactoring is reversible or if it works across files.

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 long, with the first sentence clearly stating the main purpose and the second providing specific guidance for records. There is no fluff or redundancy.

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

Completeness4/5

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

Given the complexity (7 parameters, no output schema), the description is fairly complete. It covers the main use case, record-specific behavior, and the schema covers all parameters. However, it could mention that the tool works on any method, not just records, though that is implied.

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 description coverage is 100%, so baseline is 3. The main description adds context about record constructors and the auto-detection behavior, which is not fully captured in the schema (though the schema already mentions the methodName usage). This extra context justifies a score above baseline.

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 ('Reorder parameters') and the resource ('Java method or record constructor'). It also distinguishes itself from sibling tools like add/remove parameters by noting that it updates all call sites, and it provides specific guidance for records, which is unique among siblings.

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 implies when to use the tool (for reordering parameters) and gives special instructions for records. However, it does not explicitly state when not to use it or mention alternative tools like java_add_parameter or java_remove_parameter for different changes.

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