noodlbox

Rename Symbol

Multi-file coordinated rename with confidence-tagged edits

Rename a symbol across your entire codebase. Discovers all references via the knowledge graph and AST-aware search, then previews or applies the rename with confidence tags on every edit.

Parameters

ParameterTypeRequiredDefaultDescription
repositorystringYes-Repository name (e.g., "owner/repo")
symbol_namestringNo-Symbol name to rename (e.g., "getUserById", "BookingService.validate")
symbol_uidstringNo-Direct symbol UID from prior tool calls
new_namestringYes-The new name for the symbol
file_pathstringNo-Relative file path to disambiguate common names
dry_runbooleanNotruePreview edits without modifying files

Either symbol_name or symbol_uid must be provided. Default is dry_run: true (safe preview mode). Set dry_run: false to apply changes to disk.

Usage

Ask your agent:

"Rename getUserById to findUserById"

"Preview a rename of PaymentService.process to PaymentService.execute"

"Apply the rename of validateBooking to checkBooking"

Response Format

The response is a tagged enum with two possible outcomes:

Success

When the symbol is uniquely identified, returns the rename preview or result:

{
  "status": "success",
  "old_name": "getUserById",
  "new_name": "findUserById",
  "files_affected": 4,
  "total_edits": 7,
  "graph_edits": 5,
  "ast_search_edits": 2,
  "changes": [
    {
      "file_path": "src/users/service.ts",
      "edits": [
        {
          "line": 23,
          "old_text": "export function getUserById(id: string): User {",
          "new_text": "export function findUserById(id: string): User {",
          "confidence": "graph"
        }
      ]
    },
    {
      "file_path": "src/auth/service.ts",
      "edits": [
        {
          "line": 45,
          "old_text": "const user = await getUserById(token.userId);",
          "new_text": "const user = await findUserById(token.userId);",
          "confidence": "graph"
        }
      ]
    },
    {
      "file_path": "src/users/service.spec.ts",
      "edits": [
        {
          "line": 12,
          "old_text": "describe('getUserById', () => {",
          "new_text": "describe('findUserById', () => {",
          "confidence": "ast_search"
        }
      ]
    }
  ],
  "applied": false
}

Ambiguous

When multiple symbols match the query, returns candidates for disambiguation:

{
  "status": "ambiguous",
  "message": "Found 2 symbols matching 'validate'. Use symbol_uid or file_path to disambiguate.",
  "candidates": [
    {
      "uid": "abc123",
      "name": "validate",
      "kind": "Function",
      "file_path": "src/booking/validator.ts",
      "line": 15
    },
    {
      "uid": "def456",
      "name": "validate",
      "kind": "Method",
      "file_path": "src/payment/processor.ts",
      "line": 42
    }
  ]
}

To resolve ambiguity, re-call the tool with the symbol_uid from the desired candidate.

Response Fields

Success Fields

FieldTypeDescription
old_namestringThe original symbol name
new_namestringThe new symbol name
files_affectednumberNumber of files with changes
total_editsnumberTotal number of individual edits
graph_editsnumberEdits from the knowledge graph (semantic, high confidence)
ast_search_editsnumberEdits from AST tree-sitter search (structural, lower confidence)
changesarrayPer-file changes with individual edits
appliedbooleanWhether changes were written to disk

Edit Confidence

Each edit is tagged with a confidence level indicating how it was discovered:

ConfidenceSourceMeaning
graphKnowledge graphSemantic reference from the analyzed graph. High confidence -- these are known callers, importers, and references.
ast_searchTree-sitter AST searchStructural match found by scanning AST nodes. Lower confidence -- includes test files, string literals, and references not captured by the graph.

Review ast_search edits carefully. They may include matches in comments, string literals, or unrelated symbols that happen to share the name.

File Change

FieldTypeDescription
file_pathstringRelative path within the repository
editsarrayIndividual line-level edits for this file

Rename Edit

FieldTypeDescription
linenumber1-based line number
old_textstringOriginal line text (trimmed)
new_textstringModified line text (trimmed)
confidencestring"graph" or "ast_search"

Workflow

  1. Preview the rename with dry_run: true (default)
  2. Review the edits, paying attention to ast_search confidence edits
  3. Apply by re-calling with dry_run: false

Quick Rename

For well-isolated symbols with few references:

Rename getUserById to findUserById and apply the changes

The agent will call with dry_run: false directly.

Tips

  • Always preview first for symbols with many references
  • Use symbol_uid from noodlbox_symbol_context results for unambiguous renames
  • Check graph_edits vs ast_search_edits to understand edit confidence distribution
  • Auto-accept graph edits -- they come from semantic analysis of the knowledge graph
  • Manually review ast_search edits -- they may include false positives
  • File paths are all relative to the repository root

On this page