folder_delete
Remove folders from Unity projects to manage project structure and clean up unused assets. Specify a path to delete folders and optionally remove all contents recursively.
Instructions
Delete a folder from Unity project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path of the folder to delete | |
| recursive | No | Delete all contents recursively (default: true) |
Implementation Reference
- src/tools/unity-mcp-tools.ts:512-522 (handler)Handler logic for the 'folder_delete' tool. Validates the 'path' parameter and calls the adapter's deleteFolder method with optional 'recursive' flag. Returns success message.case 'folder_delete': { if (!args.path) { throw new Error('path is required'); } await this.adapter.deleteFolder(args.path, args.recursive); return { content: [{ type: 'text', text: `Folder deleted successfully: ${args.path}` }] };
- src/tools/unity-mcp-tools.ts:282-298 (schema)Input schema definition for the 'folder_delete' tool, specifying required 'path' and optional 'recursive' boolean.{ name: 'folder_delete', description: 'Delete a folder from Unity project', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path of the folder to delete' }, recursive: { type: 'boolean', description: 'Delete all contents recursively (default: true)' } }, required: ['path'] }
- Helper method in UnityHttpAdapter that sends HTTP request to Unity server endpoint 'folder/delete' with path and recursive parameters.async deleteFolder(path: string, recursive: boolean = true): Promise<{ path: string }> { return this.call('folder/delete', { path, recursive }); }