folder_rename
Rename folders in Unity projects to organize assets and maintain project structure. Specify the current folder path and new name to update references automatically.
Instructions
Rename a folder in Unity project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| oldPath | Yes | Current path of the folder | |
| newName | Yes | New name for the folder |
Implementation Reference
- src/tools/unity-mcp-tools.ts:246-263 (registration)Registers the 'folder_rename' tool including its name, description, and input schema in the getTools() method.{ name: '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)Handler for 'folder_rename' tool in executeTool method. Validates inputs and delegates to UnityHttpAdapter.renameFolder, then formats success response.case '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}` }] }; }
- Core implementation of folder rename via HTTP POST to Unity MCP server endpoint 'folder/rename'.async renameFolder(oldPath: string, newName: string): Promise<{ oldPath: string; newPath: string; guid: string }> { return this.call('folder/rename', { oldPath, newName }); }