Skip to main content
Glama

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
NameRequiredDescriptionDefault
pathYesThe path of the directory to create

Implementation Reference

  • 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"], }, },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/koopatroopa787/first_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server