Skip to main content
Glama

plan_refactoring

Preview code refactoring changes like rename, move, extract, or modify signatures before applying them. Shows all edits as old/new text pairs for review.

Instructions

Preview any refactoring (rename, move, extract, signature) without applying. Returns all edits as {old_text, new_text} pairs. Use to review changes before applying the real tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesType of refactoring to preview
symbol_idNoSymbol ID (for rename, move symbol, signature)
new_nameNoNew name (for rename)
target_fileNoTarget file (for move symbol)
source_fileNoSource file (for move file)
new_pathNoNew path (for move file)
file_pathNoFile path (for extract)
start_lineNoStart line (for extract)
end_lineNoEnd line (for extract)
function_nameNoFunction name (for extract)
changesNoSignature changes (for signature)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behavioral traits: it's a preview operation ('Preview any refactoring... without applying'), non-destructive, and specifies the return format ('Returns all edits as {old_text, new_text} pairs'). However, it doesn't mention potential limitations like error handling or performance implications, which could be useful for a complex tool with 11 parameters.

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 highly concise and well-structured, consisting of only two sentences that front-load the core purpose and usage. Every sentence earns its place: the first explains what the tool does and its output, and the second provides clear usage guidance. There is no wasted verbiage 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 tool's complexity (11 parameters, no annotations, no output schema), the description is reasonably complete. It covers the purpose, behavioral traits (preview-only, non-destructive), and usage guidelines. However, it lacks details on error scenarios or how to interpret the output pairs in practice, which could be beneficial for such a multifaceted tool. The absence of an output schema means the description doesn't fully explain return values, but it does specify the format.

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?

The schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal parameter semantics beyond the schema by listing the refactoring types ('rename, move, extract, signature') and implying parameter usage through context (e.g., 'new_name' for rename). However, it doesn't provide additional syntax or format details, so the baseline score of 3 is appropriate as the schema does the heavy lifting.

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's purpose with specific verbs ('Preview any refactoring') and resources ('rename, move, extract, signature'), distinguishing it from sibling tools like apply_rename or apply_move by emphasizing it's a preview-only operation. It explicitly mentions what it returns ('Returns all edits as {old_text, new_text} pairs'), making the purpose distinct and unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

The description provides explicit usage guidelines by stating 'Use to review changes before applying the real tool,' which directly indicates when to use this tool (for previewing) versus alternatives (the 'real tool' for applying changes). This clearly differentiates it from sibling tools that perform actual refactoring operations, such as apply_rename or apply_move.

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/nikolai-vysotskyi/trace-mcp'

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