Skip to main content
Glama
egn88

Refactor MCP

by egn88

java_add_parameter

Add a new parameter to a Java method or record constructor and automatically update all call sites, including record declarations. Supports overload matching and dry-run preview.

Instructions

Add a new parameter to a Java method or record constructor and update all call sites. For Java records, use methodName "" or the class name to target the constructor - the tool auto-detects records and updates both the record declaration AND all "new RecordName(...)" call sites (adding null as the new argument value).

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
parameterNameYesName of the new parameter
parameterTypeYesType of the new parameter
parameterIndexNoPosition to insert parameter (0-indexed)
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 must disclose all behavioral traits. It mentions auto-detection of records, updating call sites, and adding null for new arguments in records. However, it omits details on handling method overloading, constructors vs. regular methods, and potential side effects, leaving some transparency gaps.

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 with no wasted words. The first sentence states the core purpose, and the second provides critical detail on records. It is front-loaded and perfectly concise.

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 9 parameters, 5 required, no output schema, and many siblings, the description covers the main purpose, record handling, and call site updates. It lacks guidance on when to use this vs. java_change_method_signature, and does not describe return values or error states, but is largely complete.

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 coverage is 100% with detailed descriptions for all 9 parameters. The description adds value by explaining record auto-detection and call site updates, but does not significantly enhance parameter understanding beyond the schema. Baseline 3 is appropriate.

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 adds a parameter to a Java method or record constructor and updates call sites. It specifies the verb 'Add', resource 'Java method or record constructor', and distinguishes from siblings like java_remove_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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for adding parameters with automatic call site updates, and gives guidance for records (use methodName '<init>' or class name). However, it does not explicitly contrast with siblings like java_change_method_signature or typescript_add_parameter, nor does it provide when-not-to-use scenarios.

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