Browse documentation

rename_symbol

[refactoring]

Renames a symbol in live workspace documents. Disk files remain unchanged.

Before you use this tool

Applies edits to live documents. Preview each write_file save, then apply with its diskFingerprint and the current document version.

Try it locally in the TGlider playground

Parameters

NameTypeRequiredDescription
symbolKeystringYesStable symbol key returned by a prior symbol discovery tool.
newNamestringYesNew symbol name.
scopestringNoRename scope: 'same-project', 'direct-dependents', or 'transitive-dependents'. Default: "same-project"
allowPartialbooleanNoAllow applying a partial rename when some projects cannot be resolved safely. Default: false

Examples

Replace sample paths and symbol keys with values from your workspace.

Apply a semantic rename

Arguments
{
  "symbolKey": "role=canonical|...",
  "newName": "AccountService"
}
Full MCP request
Full MCP request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "rename_symbol",
    "arguments": {
      "symbolKey": "role=canonical|...",
      "newName": "AccountService"
    }
  }
}

Response Notes

Returns applied live-document edits, current document versions, skipped projects, and post-apply diagnostics. Read each changed document with get_file_contents and check for truncation. Preview write_file with the full text. Apply with its diskFingerprint and the current expectedVersion. Closing an unsaved document discards its overlay.