Skip to main content
Glama

rename_symbol

Renames any Java symbol across a project by providing the new name and the symbol's location. Returns text edits to apply 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
newNameYesNew name for the symbol
lineYesZero-based line number
columnYesZero-based column number
filePathYesPath to source file containing the symbol
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses zero-based coordinates, that it returns text edits, and the need for load_project. It implies the tool finds all occurrences, which is clear. However, it does not specify what happens if the symbol is not found or if it modifies files directly (it returns edits, so not directly destructive).

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?

Description is concise with clear sections (USAGE, OUTPUT, IMPORTANT). Every sentence adds value: purpose, returns type, usage instruction, coordinate system, and prerequisite. No redundant or vague language.

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 tool with 4 parameters, 100% schema coverage, and no output schema, the description covers prerequisite, coordinate system, and the nature of output (list of text edits). It is complete enough for the agent to understand how to invoke it. Minor gaps: no mention of error handling or what happens if symbol is ambiguous.

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?

Input schema has 100% description coverage for all parameters. The description only reiterates 'new name' for newName and 'zero-based' for line/column, adding minimal extra meaning beyond the schema. The filePath parameter is clearly described in schema. Thus, description adds little additional semantic value.

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?

Description clearly states the verb 'Rename' and the resource 'symbol (variable, method, field, class, etc.)'. It specifies the scope 'across the project', which distinguishes it from sibling tools like 'change_method_signature' or 'extract_variable'.

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?

Explicit usage instructions: 'Position on symbol, provide new name' and prerequisite 'Requires load_project to be called first'. Also explains that the output is text edits to be applied. However, it does not mention when not to use this tool or alternatives.

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