Rename a component (its entityRef)
r3_component_renameRename a component: its entityRef, the name scripts address it by (this['name'] / this.name), and its display name when that is where the entityRef came from. Name it by entityRef or componentId. Without planId it only PLANS and changes nothing: it checks the new name (refused: not an entityRef R3 makes, a reserved name, or taken in the same namespace: inside the same Entity, or at project level, naming the holder), and lists every Code script whose this['old'] / this.old finds THIS component (a script inside an Entity finds its own member first), with codeVersion and line numbers, plus scripts where the name is ambiguous and scripts that already read the new name. With that planId it applies the plan as ONE undoable change every open R3 tab sees. updateCode: true also rewrites those scripts in the same change (each on the version planned: one changed since refuses the whole rename, never merged); without it they keep the old name and silently find nothing. If anything changed since the plan, nothing is written and the new plan is returned.
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": {
"projectId": "<projectId>",
"newRef": "<newRef>"
},
"name": "r3_component_rename"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| newRef | Yes | The new entityRef: lower case, _ instead of spaces, @ and dots (e.g. "arena_ground"). | |
| planId | No | The plan being applied, from this tool without planId (same component and newRef). Leave it out to plan. | |
| entityRef | No | The component to rename, by its entityRef (or its id). Or use componentId. | |
| projectId | Yes | The project, from r3_project_load. | |
| updateCode | No | With planId: also rewrite this['old'] / this.old in the listed scripts, in the same change. Default false. | |
| componentId | No | The component to rename, by its id (needed when several share the entityRef). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seq | Yes | ||
| answer | Yes | This answer in words: what was done, what R3 measured, decided or refused, and what to do next. The same text as the result's text block. Read it: the fields beside it are the data, this is the guidance. | |
| newRef | Yes | ||
| oldRef | Yes | ||
| planId | Yes | ||
| applied | Yes | ||
| patched | Yes | ||
| scripts | Yes | ||
| refusals | Yes | ||
| template | Yes | ||
| component | Yes | ||
| projectId | Yes | ||
| applicable | Yes | ||
| nameChange | Yes | ||
| notPatched | Yes | ||
| updateCode | Yes | ||
| environment | Yes | ||
| modulesScanned | Yes | ||
| newNameReaders | Yes | ||
| templateCopies | Yes | ||
| ambiguousScripts | Yes |