Skip to main content
Glama
Project Scope MCP Server

Project Scope MCP Server

refactor_rename

Rename variables, functions, or classes across your entire codebase with a preview of changes, then optionally apply them.

Instructions

Rename a symbol (variable, function, class) across the entire codebase. Returns preview of changes, optionally applies them.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "filePath": "<filePath>",
      "symbolName": "<symbolName>",
      "newName": "<newName>"
    },
    "name": "refactor_rename"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesRoot path of the repository
applyNoApply changes (default: false, preview only)
newNameYesNew name for the symbol
filePathYesPath to file containing the symbol
symbolNameYesCurrent name of the symbol

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations at all, the description carries the full burden, and it does disclose the two operating modes (preview vs. apply) plus the breadth of the edit ('entire codebase'). It omits critical mutation facts: whether applied changes are reversible, whether there is a conflict/ambiguity failure mode, and whether edits can touch files outside the given root.

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 short sentences, front-loaded with the core action and followed by the return/apply behavior. No filler, though the second sentence is compressed enough that its meaning relies on the reader parsing 'optionally applies them' correctly.

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

Completeness3/5

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

For a five-parameter mutation tool with no annotations and no output schema, the description is thin. The most confusing aspect of the call — why both a repo root 'path' and a 'filePath' are required, and which one scopes the search — is left entirely unexplained, as is the shape of the preview.

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 all five parameters are already documented, making 3 the baseline. The description adds nothing about the relationship between 'path' and 'filePath' or about what the returned preview contains, so it does not improve on the schema.

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?

States a specific verb and resource ('Rename a symbol') with concrete examples of symbol kinds and an explicit scope ('across the entire codebase'). It is clearly distinct from siblings like refactor_extract_function and refactor_inline_variable, though it never names them, so differentiation is inferred rather than stated.

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

Usage Guidelines3/5

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

The phrase 'Returns preview of changes, optionally applies them' implies a preview-then-apply workflow, and the apply flag being opt-in reinforces that ordering. However, there is no explicit guidance on when to use this versus analyze_impact to check blast radius first, and no stated preconditions for invoking it.

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