create_directory
Create new directories or verify existing ones on your PC, including nested folders in a single operation. This tool manages directory structures for file organization and system control.
Instructions
Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. If the directory already exists, this operation will succeed silently.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path of the directory to create |
Implementation Reference
- src/index.ts:342-353 (handler)The switch case handler for the 'create_directory' tool. It extracts the path from arguments, creates the directory using fs.mkdir with recursive: true, and returns a success message.case "create_directory": { const dirPath = args.path as string; await fs.mkdir(dirPath, { recursive: true }); return { content: [ { type: "text", text: `Successfully created directory ${dirPath}`, }, ], }; }
- src/index.ts:84-97 (registration)Registration of the 'create_directory' tool in the TOOLS array. Defines the name, description, and input schema (path: string).{ name: "create_directory", description: "Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. If the directory already exists, this operation will succeed silently.", inputSchema: { type: "object", properties: { path: { type: "string", description: "The path of the directory to create", }, }, required: ["path"], }, },