Skip to main content
Glama
ai-yliu

Filesystem MCP Server

by ai-yliu

create_directory

Create a new directory or verify its existence at a specified path to organize files and manage storage structure.

Instructions

Create new directory or ensure it exists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the directory to create

Implementation Reference

  • The handler logic for the 'create_directory' tool. It validates the provided path, ensures the directory exists using fs.ensureDir, and returns a success message.
    case 'create_directory': {
      const { path: dirPath } = request.params.arguments as { path: string };
      validatePath(dirPath);
      
      await fs.ensureDir(dirPath);
      
      return {
        content: [
          {
            type: 'text',
            text: `Directory created successfully: ${dirPath}`,
          },
        ],
      };
    }
  • src/index.ts:144-157 (registration)
    Registration of the 'create_directory' tool in the ListTools response, including its name, description, and input schema definition.
    {
      name: 'create_directory',
      description: 'Create new directory or ensure it exists',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'Path to the directory to create',
          },
        },
        required: ['path'],
      },
    },
  • Input schema for the 'create_directory' tool, defining the required 'path' parameter.
    inputSchema: {
      type: 'object',
      properties: {
        path: {
          type: 'string',
          description: 'Path to the directory to create',
        },
      },
      required: ['path'],
    },
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 hints at idempotency ('or ensure it exists') which is valuable, but doesn't disclose critical behavioral traits like permissions required, whether parent directories must exist, error conditions, or what happens on conflicts. For a mutation tool with zero annotation coverage, this leaves significant gaps.

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?

The description is extremely concise (6 words) and front-loaded with the core functionality. Every word earns its place by conveying both creation and idempotency in minimal text, with no wasted sentences.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks information about what happens on success (e.g., returns created path, confirmation message), error handling, permissions, or system constraints. The idempotency hint is helpful but insufficient for full contextual understanding.

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 100%, so the schema already documents the single 'path' parameter adequately. The description doesn't add any parameter-specific details beyond what the schema provides (e.g., path format, relative vs absolute). Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('create') and resource ('directory'), and adds nuance with 'or ensure it exists' which clarifies idempotent behavior. However, it doesn't explicitly distinguish this from sibling tools like 'list_directory' or 'move_file', which would require more specific differentiation.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'list_allowed_directories' and 'move_file', there's no indication of prerequisites, constraints, or appropriate contexts for directory creation versus other file system operations.

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/ai-yliu/filesystem-mcp-server'

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