Skip to main content
Glama

rename_symbol

Rename Java symbols like variables, methods, and classes across your entire project with compiler-accurate refactoring. Provide the file location and new name to generate precise text edits for all occurrences.

Instructions

Rename a symbol (variable, method, field, class, etc.) across the project.

Returns text edits for all occurrences that need to be changed. The caller should apply these edits to perform the rename.

USAGE: Position on symbol, provide new name OUTPUT: List of text edits to apply

IMPORTANT: Uses ZERO-BASED coordinates.

Requires load_project to be called first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
columnYesZero-based column number
lineYesZero-based line number
newNameYesNew name for the symbol
filePathYesPath to source file containing the symbol
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 explains that the tool returns text edits for the caller to apply, specifies the coordinate system ('ZERO-BASED coordinates'), and states the project-wide scope. However, it doesn't mention potential limitations like symbol resolution failures or edit conflicts.

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 efficiently structured with clear sections (purpose, returns, usage, output, important note, prerequisite). Every sentence adds essential information with zero waste, and critical details like coordinate system and prerequisite are appropriately emphasized.

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?

For a complex refactoring tool with no annotations and no output schema, the description does well by explaining the behavioral workflow (returns edits, caller applies them) and prerequisite. However, it could better address potential edge cases or error conditions to be fully complete for this operation type.

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 description coverage is 100%, so the schema already documents all four parameters. The description adds minimal value beyond the schema by implying the parameters are used together ('Position on symbol, provide new name'), but doesn't provide additional syntax or format details. This meets the baseline for high schema coverage.

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 specific action ('rename a symbol') and scope ('across the project'), distinguishing it from sibling tools like 'change_method_signature' or 'extract_variable' which perform different refactoring operations. It explicitly lists the types of symbols affected (variable, method, field, class, etc.), making the purpose 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 instructions ('Position on symbol, provide new name') and a critical prerequisite ('Requires load_project to be called first'). It also distinguishes this tool from alternatives by specifying it returns text edits rather than applying them directly, guiding the agent on how to use it correctly.

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/pzalutski-pixel/javalens-mcp'

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