Skip to main content
Glama
falahgs

3D Cartoon Generator & File System MCP Server

by falahgs

create_directory

Create a new directory at a specified path to organize files within the file system.

Instructions

Create a new directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the directory to create

Implementation Reference

  • The handler case for the 'create_directory' tool. It validates the path using validatePath, calls fsPromises.mkdir with recursive:true, and returns a success response.
    case "create_directory": {
      const validPath = await validatePath(args.path);
      await fsPromises.mkdir(validPath, { recursive: true });
      return {
        toolResult: {
          success: true,
          content: [{ type: "text", text: `Directory created: ${args.path}` }],
          message: `Created directory: ${args.path}`
        }
      };
    }
  • The tool registration with inputSchema for 'create_directory'. Defines a single required 'path' string parameter.
    {
      name: "create_directory",
      description: "Create a new directory",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "Path to the directory to create"
          }
        },
        required: ["path"]
      }
  • src/index.ts:277-387 (registration)
    The ListToolsRequestSchema handler that registers all available tools including 'create_directory'.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          // Image generation tool
          {
            name: "generate_3d_cartoon",
            description: "Generates a 3D style cartoon image for kids based on the given prompt",
            inputSchema: {
              type: "object",
              properties: {
                prompt: {
                  type: "string",
                  description: "The prompt describing the 3D cartoon image to generate"
                },
                fileName: {
                  type: "string",
                  description: "The name of the output file (without extension)"
                }
              },
              required: ["prompt", "fileName"]
            }
          },
          // File system tools
          {
            name: "read_file",
            description: "Read the contents of a file",
            inputSchema: {
              type: "object",
              properties: {
                path: {
                  type: "string",
                  description: "Path to the file to read"
                }
              },
              required: ["path"]
            }
          },
          {
            name: "write_file",
            description: "Write content to a file",
            inputSchema: {
              type: "object",
              properties: {
                path: {
                  type: "string",
                  description: "Path to the file to write"
                },
                content: {
                  type: "string",
                  description: "Content to write to the file"
                }
              },
              required: ["path", "content"]
            }
          },
          {
            name: "list_directory",
            description: "List the contents of a directory",
            inputSchema: {
              type: "object",
              properties: {
                path: {
                  type: "string",
                  description: "Path to the directory to list"
                }
              },
              required: ["path"]
            }
          },
          {
            name: "create_directory",
            description: "Create a new directory",
            inputSchema: {
              type: "object",
              properties: {
                path: {
                  type: "string",
                  description: "Path to the directory to create"
                }
              },
              required: ["path"]
            }
          },
          {
            name: "search_files",
            description: "Search for files matching a pattern",
            inputSchema: {
              type: "object",
              properties: {
                path: {
                  type: "string",
                  description: "Base directory to search from"
                },
                pattern: {
                  type: "string",
                  description: "Search pattern (glob format)"
                },
                excludePatterns: {
                  type: "array",
                  items: {
                    type: "string"
                  },
                  description: "Patterns to exclude from search (glob format)"
                }
              },
              required: ["path", "pattern"]
            }
          }
        ]
      };
    });

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It does not specify whether intermediate directories are created, what happens if the directory already exists, or any permissions required. The simple description omits critical behavioral details.

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

Conciseness4/5

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

The description is a single, clear sentence with no unnecessary words. It is appropriate for a simple operation, though it could arguably be expanded slightly for completeness.

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 the lack of annotations and output schema, the description is insufficiently complete. It does not explain return values, error conditions, or path semantics (e.g., absolute vs relative), leaving gaps for an agent.

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?

The schema provides 100% coverage for the single parameter 'path' with a clear description. The tool description adds no additional meaning beyond the schema, earning a baseline score of 3.

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 'Create a new directory' uses a specific verb and resource, clearly distinguishing it from sibling tools like read_file, write_file, or list_directory which operate on files rather than directories.

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?

No guidance is provided on when to use this tool versus alternatives, such as when to create a directory versus using write_file for file creation. No prerequisites or conditions are mentioned.

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