Skip to main content
Glama

surgical_replace_symbol

Replaces a named code symbol with a new name in a specified file to perform precise, collision-free refactoring at the AST level.

Instructions

Surgically refactor symbol

Input Schema

NameRequiredDescriptionDefault
file_pathYes
new_symbolYes
old_symbolYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

C2.3/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. "Refactor" implies code mutation, but the description never states that the file is overwritten, whether all matches or one match is replaced, what happens on ambiguous or zero matches, or whether edits are reversible.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

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

A three-word phrase is not wasteful but is under-specified rather than concise; "surgically" consumes space without conveying behavior. There is no front-loaded statement of what the tool does to the file.

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

Completeness2/5

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

A mutation tool with zero annotations, no output schema, and 0% parameter documentation needs substantially more description than this. An agent has to guess at matching scope, side effects, and return information before it can safely invoke it.

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

Parameters2/5

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

Schema description coverage is 0% and all three parameters (old_symbol, new_symbol, file_path) are undocumented. The parameter names hint at an old-to-new replacement in a single file, but the description adds no matching rules, format expectations (fully qualified vs bare names), or scope semantics.

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

Purpose3/5

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

"Refactor" + "symbol" gives a rough verb+resource, but "surgically" is decorative and the phrase never says what actually happens (replacing occurrences of old_symbol with new_symbol in a file). Nothing distinguishes it from sibling find_symbol_references or find_symbol_definition.

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

Usage Guidelines2/5

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

There is no when-to-use, when-not-to-use, or alternative routing at all; an agent cannot tell whether to call find_symbol_references first or whether this tool handles all occurrences. The only hint is the word "surgically," which implies precision but not a decision rule.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.