create_directory
Create new directories on Windows systems by specifying the desired path. This tool enables automated folder creation for organizing files and managing directory structures.
Instructions
创建目录
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | 目录路径 |
Input Schema (JSON Schema)
{
"properties": {
"path": {
"description": "目录路径",
"type": "string"
}
},
"required": [
"path"
],
"type": "object"
}
Implementation Reference
- src/tools/filesystem.js:170-177 (handler)The handler function that implements the create_directory tool logic using fs.mkdir to create the directory recursively.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)The input schema and tool definition for create_directory, requiring a 'path' parameter.{ 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 that dispatches create_directory calls to the handler.case 'create_directory': return await this.createDirectory(args.path);
- src/tools/filesystem.js:110-111 (registration)Inclusion of 'create_directory' in the tools list used by canHandle method for tool routing.const tools = ['read_file', 'write_file', 'list_directory', 'create_directory', 'delete_file', 'copy_file', 'move_file', 'search_files'];