folder_rename
Rename folders within Unity projects using direct input of current path and new name, streamlining asset management and organization.
Instructions
Rename a folder in Unity project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| newName | Yes | New name for the folder | |
| oldPath | Yes | Current path of the folder |
Implementation Reference
- src/tools/unity-mcp-tools.ts:247-263 (registration)Tool registration including name, description, and input schema for folder_renamename: 'folder_rename', description: 'Rename a folder in Unity project', inputSchema: { type: 'object', properties: { oldPath: { type: 'string', description: 'Current path of the folder' }, newName: { type: 'string', description: 'New name for the folder' } }, required: ['oldPath', 'newName'] } },
- src/tools/unity-mcp-tools.ts:486-497 (handler)Main handler logic for executing the folder_rename tool: validates parameters and delegates to UnityHttpAdaptercase 'folder_rename': { if (!args.oldPath || !args.newName) { throw new Error('oldPath and newName are required'); } const result = await this.adapter.renameFolder(args.oldPath, args.newName); return { content: [{ type: 'text', text: `Folder renamed successfully:\nOld Path: ${result.oldPath}\nNew Path: ${result.newPath}\nGUID: ${result.guid}` }] }; }
- Adapter helper method that performs the HTTP call to Unity server for renaming a folderasync renameFolder(oldPath: string, newName: string): Promise<{ oldPath: string; newPath: string; guid: string }> { return this.call('folder/rename', { oldPath, newName }); }