create_directory
Create new directories on Windows systems to organize files and manage storage structure. Specify the path where the directory should be created.
Instructions
创建目录
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | 目录路径 |
Implementation Reference
- src/tools/filesystem.js:170-177 (handler)The handler function that creates the directory using fs.mkdir with recursive option and returns success/error response.async createDirectory(dirPath) { try { await fs.mkdir(dirPath, { recursive: true }); return { success: true, path: dirPath, message: '目录创建成功' }; } catch (error) { return { success: false, error: error.message }; } }
- src/tools/filesystem.js:48-58 (schema)Tool definition including name, description, and input schema for the create_directory tool.{ name: 'create_directory', description: '创建目录', inputSchema: { type: 'object', properties: { path: { type: 'string', description: '目录路径' }, }, required: ['path'], }, },
- src/tools/filesystem.js:123-124 (registration)Registration in the executeTool switch statement dispatching to the createDirectory handler.case 'create_directory': return await this.createDirectory(args.path);
- src/tools/filesystem.js:110-111 (registration)Inclusion in the canHandle tools array for checking if the tool can be handled.const tools = ['read_file', 'write_file', 'list_directory', 'create_directory', 'delete_file', 'copy_file', 'move_file', 'search_files'];