Skip to main content
Glama

Prepare a project-wide structural rename

ast_rename_symbol
Read-only

Generates a hash-bound rename plan for a symbol in TypeScript or JavaScript code. Preview the prepared plan, then apply it by its operation ID to safely update references across the project without writing changes directly.

Instructions

Prepares an exact hash-bound rename plan without writing. Review the preview and apply its operation_id with ast_apply_operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNoCompatibility field. Direct application is disabled; this tool always prepares.
new_nameYesNew identifier only, without a container prefix.
file_pathYes
symbol_pathYes
project_rootYes
allow_new_errorsNoPermit a plan with new TypeScript errors after explicit review.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
kindYes
statusYes
blockedYes
previewYes
plan_hashYes
created_atYes
expires_atYes
diagnosticsYes
block_reasonYes
operation_idYes
project_rootYes
affected_filesYes
workspace_hashYes
reference_countYes
allow_new_errorsYes
preview_truncatedYes
workspace_file_countYes
Behavior4/5

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

The description adds meaningful behavioral context beyond annotations: it explicitly states 'without writing' and 'this tool always prepares,' confirming read-only behavior consistent with readOnlyHint=true. It also discloses the workflow nuance that preview review and operation_id application are required, and mentions the dry_run compatibility field is disabled. No contradictions 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, efficient and front-loaded. The description wastes no words and packages meaning about behavior plus the follow-up workflow. Minor gap: could mention the output (operation_id) format, but output schema exists to cover that.

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 6-parameter tool with an output schema and strong annotations (readOnlyHint=true), the description does reasonable work. It explains the prepare-only workflow and the apply step. However, it doesn't clarify the semantic relationship between file_path/symbol_path (how the path is resolved) or what 'exact hash-bound' means practically, which is non-trivial given the tool's complexity.

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 50%, covering dry_run, new_name, and allow_new_errors in the schema. The description adds minimal parameter-level meaning beyond the schema - it notes the dry_run field is a 'Compatibility field' and that direct application is disabled. However, critical params like file_path, symbol_path, and project_root lack description coverage and the tool description doesn't clarify their semantics either, leaving ambiguity in how symbol_path and new_name interact.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states it 'Prepares an exact hash-bound rename plan without writing' - a specific verb (prepare) with resource (rename plan). It distinguishes from siblings by mentioning it doesn't write and points to ast_apply_operation for application, though the sibling differentiation is implicit rather than explicitly naming competing rename tools. Clear purpose that distinguishes from application tools.

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 description provides clear usage context: 'Review the preview and apply its operation_id with ast_apply_operation.' This instructs when/how to use the tool and points to the appropriate next tool. However, it doesn't explicitly say when NOT to use this versus alternatives like ast_replace_symbol_body or when to prefer this tool over others in the sibling set.

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/yailPeralta/ast-mcp-server'

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