Skip to main content
Glama
StrawHatAI

Claude Desktop Commander MCP

by StrawHatAI

create_directory

Create new directories or ensure existing ones are available, including nested structures, within permitted file system locations.

Instructions

Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • The main handler function that validates the directory path and creates the directory using Node.js fs.mkdir with recursive option to handle nested paths.
    export async function createDirectory(dirPath: string): Promise<void> {
        const validPath = await validatePath(dirPath);
        await fs.mkdir(validPath, { recursive: true });
    }
  • The dispatch handler in the main tool request handler that parses input arguments using the schema and calls the specific createDirectory function.
    case "create_directory": {
      const parsed = CreateDirectoryArgsSchema.parse(args);
      await createDirectory(parsed.path);
      return {
        content: [{ type: "text", text: `Successfully created directory ${parsed.path}` }],
      };
  • Zod schema defining the input arguments for the create_directory tool: a required 'path' string.
    export const CreateDirectoryArgsSchema = z.object({
      path: z.string(),
    });
  • src/server.ts:149-155 (registration)
    Registers the create_directory tool in the MCP server tools list, providing name, description, and JSON schema derived from Zod schema.
    {
      name: "create_directory",
      description:
        "Create a new directory or ensure a directory exists. Can create multiple " +
        "nested directories in one operation. Only works within allowed directories.",
      inputSchema: zodToJsonSchema(CreateDirectoryArgsSchema),
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'Only works within allowed directories' (a constraint) and 'Can create multiple nested directories' (a capability), but doesn't disclose critical behavioral traits like permissions needed, whether it overwrites existing directories, error handling, or response format. For a mutation tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each adding value: first states purpose, second adds capability (nested directories), third adds constraint (allowed directories). No wasted words, front-loaded with core functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given complexity (mutation tool creating directories), no annotations, no output schema, and low schema coverage (0%), the description is incomplete. It lacks details on permissions, error cases, return values, or how 'ensure exists' differs from 'create'. Should provide more context for safe usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It implies the 'path' parameter is used for creating directories, including nested ones, but doesn't specify format (e.g., absolute/relative paths), constraints, or examples. The description adds some meaning but doesn't fully compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('create' or 'ensure exists') and resource ('directory'), with specific details about creating nested directories in one operation. It distinguishes from siblings like 'list_directory' (read-only) and 'move_file' (different operation).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context with 'Only works within allowed directories', which implies a constraint but doesn't explicitly state when to use alternatives (e.g., no comparison to 'list_allowed_directories' for checking permissions). It lacks explicit exclusions or named alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/StrawHatAI/claude-dev-tools'

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