Skip to main content
Glama

introduce_parameter_object

Bundle a method's parameters into a new parameter-object class and rewrite the method and all callers to use it, simplifying signatures across your Java codebase.

Instructions

Bundle a method's parameters into a new parameter-object class and rewrite the method and all callers to use it. The class is generated as a member of the declaring type.

USAGE: Position on the method name; optionally name the class and parameter. OUTPUT: editsByFile with all required edits; 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.

IMPORTANT: Uses ZERO-BASED coordinates.

Requires load_project to be called first.

Input Schema

NameRequiredDescriptionDefault
lineYesZero-based line number of the method declaration
columnYesZero-based column number (on the method name)
filePathYesPath to source file containing the method
classNameNoName for the parameter-object class (default: <MethodName>Parameters)
parameterNameNoName for the new parameter (default: parameterObject)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.1

TDQS

A4.1/5.0
Behavior4/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 well: it discloses the prerequisite (load_project), that edits are returned as text and must be applied by the caller, and that coordinates are zero-based. It does not discuss safety/reversibility, but for a refactoring generator that is minor.

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-loaded purpose followed by clearly labeled USAGE, OUTPUT, IMPORTANT, and prerequisite sections. The warning-ordering sentence is dense but informative; overall it earns its length with no filler.

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?

There is no output schema or annotations, so the description must explain the return, and it does: editsByFile with edits and warnings, plus the ordering rule and the apply-it-yourself instruction. Combined with the load_project prerequisite, an agent has enough to invoke and use it correctly.

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%, so the schema already documents all five parameters including defaults. The description only restates that class and parameter names are optional, adding no syntax or format detail beyond the schema. Baseline 3 applies.

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 refactoring verb and resource: bundle parameters into a new parameter-object class and rewrite the method plus all callers. It is clearly distinguishable from siblings like extract_method, extract_variable, and change_method_signature.

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 USAGE line says where to position (on the method name) and that class/parameter naming is optional, and it names the prerequisite 'Requires load_project to be called first.' It does not explicitly contrast with alternative refactorings, but the context is clear.

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