folder_create
Create new folders in Unity projects to organize assets and scripts. Specify the path to add structure to your project directory.
Instructions
Create a new folder in Unity project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path for the new folder (e.g., Assets/MyFolder) |
Implementation Reference
- src/tools/unity-mcp-tools.ts:473-484 (handler)The main handler for the 'folder_create' tool in the executeTool method's switch statement. It validates the required 'path' parameter, calls the adapter's createFolder method, and returns a formatted success message with the created folder's path and GUID.case 'folder_create': { if (!args.path) { throw new Error('path is required'); } const result = await this.adapter.createFolder(args.path); return { content: [{ type: 'text', text: `Folder created successfully:\nPath: ${result.path}\nGUID: ${result.guid}` }] }; }
- src/tools/unity-mcp-tools.ts:232-245 (registration)Registration of the 'folder_create' tool in the getTools() method, defining its name, description, and input schema requiring a 'path' parameter.{ name: 'folder_create', description: 'Create a new folder in Unity project', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path for the new folder (e.g., Assets/MyFolder)' } }, required: ['path'] } },
- Supporting method in UnityHttpAdapter that implements the folder creation by calling the Unity HTTP server's 'folder/create' endpoint via the generic call() method.async createFolder(path: string): Promise<{ path: string; guid: string }> { return this.call('folder/create', { path }); }