Skip to main content
Glama

apply_rename

Rename a symbol across all usages, detecting collisions first. Preview changes with dry-run mode, then apply to modify source files.

Instructions

Rename a symbol across all usages (definition + all importing files). Runs collision detection first and aborts on conflicts. Dry-run by default — preview the plan, then re-call with dry_run: false to apply. Returns the list of edits applied. Modifies source files when dry_run is false. Use check_rename first to verify safety; use plan_refactoring with type="rename" to preview edits. Returns JSON: { success, edits: [{ file, old_text, new_text }], filesModified }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbol_idYesSymbol ID to rename (from search or outline)
new_nameYesNew name for the symbol
dry_runNoPreview changes without applying (default: true). Set to false to apply.
confirm_largeNoRequired when >20 files would be modified. Acknowledges large-scale change.
Behavior5/5

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

Despite annotations not indicating potential destructiveness, the description explicitly states it modifies source files when dry_run is false, runs collision detection, and aborts on conflicts. No contradiction with annotations.

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?

Five sentences, each valuable. Front-loaded with main action, covers collision detection, dry-run behavior, return format, and alternative tools. No fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of renaming across files with safety checks, the description covers behavior, prerequisites, return format, and use of confirm_large. No output schema, but return format is described. Comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, baseline 3. The description adds meaning by explaining dry_run default behavior, the need for confirm_large for large changes, and that symbol_id comes from search/outline. This exceeds schema details.

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 renames a symbol across all usages, including definition and importing files. It distinguishes itself from sibling tools like check_rename and plan_refactoring by specifying use cases.

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?

Provides explicit guidance: 'Use check_rename first to verify safety; use plan_refactoring with type="rename" to preview edits.' This tells the agent when to use 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/nikolai-vysotskyi/trace-mcp'

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