folder_move
Relocate folders in Unity projects by specifying source and target paths, ensuring organized asset management and streamlined project workflows.
Instructions
Move a folder to a new location in Unity project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sourcePath | Yes | Current path of the folder | |
| targetPath | Yes | Target path for the folder |
Implementation Reference
- src/tools/unity-mcp-tools.ts:499-510 (handler)Handler for the folder_move MCP tool. Validates input arguments and delegates execution to UnityHttpAdapter.moveFolder method, returning success message with paths and GUID.case 'folder_move': { if (!args.sourcePath || !args.targetPath) { throw new Error('sourcePath and targetPath are required'); } const result = await this.adapter.moveFolder(args.sourcePath, args.targetPath); return { content: [{ type: 'text', text: `Folder moved successfully:\nFrom: ${result.sourcePath}\nTo: ${result.targetPath}\nGUID: ${result.guid}` }] }; }
- src/tools/unity-mcp-tools.ts:264-281 (schema)Tool registration and input schema definition for folder_move in the MCP tools array returned by getTools().{ name: 'folder_move', description: 'Move a folder to a new location in Unity project', inputSchema: { type: 'object', properties: { sourcePath: { type: 'string', description: 'Current path of the folder' }, targetPath: { type: 'string', description: 'Target path for the folder' } }, required: ['sourcePath', 'targetPath'] } },
- Supporting method in UnityHttpAdapter that sends HTTP request to Unity server endpoint 'folder/move' to perform the folder move operation.async moveFolder(sourcePath: string, targetPath: string): Promise<{ sourcePath: string; targetPath: string; guid: string }> { return this.call('folder/move', { sourcePath, targetPath }); }