Skip to main content
Glama
FutureAtoms

Agentic Control Framework (ACF)

by FutureAtoms

create_directory

Create a new directory at the specified path to organize files and folders.

Instructions

Create directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • The actual implementation of create_directory: resolves the path, checks if it's allowed via isPathAllowed, then calls fs.mkdirSync with {recursive:true} to create the directory.
    function createDirectory(dirPath, allowedDirs) {
      try {
        if (!dirPath) {
          return { success: false, message: 'No directory path provided' };
        }
    
        if (!isPathAllowed(dirPath, allowedDirs)) {
          return { success: false, message: `Access to path "${dirPath}" is not allowed` };
        }
    
        const resolvedPath = path.resolve(dirPath);
        
        // Create the directory
        fs.mkdirSync(resolvedPath, { recursive: true });
    
        return {
          success: true,
          message: `Directory created successfully: ${dirPath}`,
          path: dirPath
        };
      } catch (error) {
        logger.error(`Error creating directory: ${error.message}`);
        return { success: false, message: `Error creating directory: ${error.message}` };
      }
    }
  • Registration of the 'create_directory' tool in the MCP tools/list response with inputSchema requiring 'path'.
    { name:'create_directory', description:'Create directory'+(readonlyMode?' (RO)':''), inputSchema:{ type:'object', properties:{ path:{type:'string'} }, required:['path'] } },
    { name:'tree', description:'Directory tree', inputSchema:{ type:'object', properties:{ path:{type:'string'}, depth:{type:'number'}, follow_symlinks:{type:'boolean'} }, required:['path'] } },
  • Dispatch in the tools/call handler: checks readonly mode, then calls filesystemTools.createDirectory(args.path, allowedDirectories).
    case 'create_directory':
      if (!checkReadOnly('create_directory')) { data = { success:false, message:'Operation not allowed: read-only mode' }; break; }
      data = filesystemTools.createDirectory(args.path, allowedDirectories);
      break;
  • The isPathAllowed helper function used by createDirectory to validate the path is within allowed directories.
    function isPathAllowed(filePath, allowedDirs) {
      if (!allowedDirs || !Array.isArray(allowedDirs) || allowedDirs.length === 0) {
        logger.error('No allowed directories configured');
        return false;
      }
    
      // Resolve to absolute path
      const resolvedPath = path.resolve(filePath);
      
      // Check if the path is within any of the allowed directories
      return allowedDirs.some(dir => {
        const resolvedDir = path.resolve(dir);
        return resolvedPath === resolvedDir || resolvedPath.startsWith(resolvedDir + path.sep);
      });
    }
  • Input schema for create_directory: type 'object' with a required 'path' property of type 'string'.
    { name:'create_directory', description:'Create directory'+(readonlyMode?' (RO)':''), inputSchema:{ type:'object', properties:{ path:{type:'string'} }, required:['path'] } },
Behavior1/5

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

With no annotations, the description fully carries the burden of disclosing behavior. It fails to mention what happens if the directory already exists, whether parent directories are created, permissions required, or any side effects.

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

Conciseness2/5

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

The description is too short (two words) and under-specified. It does not provide enough information to justify its length; a single sentence with essential details would be more appropriate.

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

Completeness1/5

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

Given the lack of annotations, no output schema, and a single parameter with zero description coverage, the description is completely inadequate. It omits crucial information about return values, error handling, and operational context.

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

Parameters1/5

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

The input schema has one parameter (path) with 0% schema description coverage. The description adds no meaning beyond what the schema provides, e.g., not specifying path format (absolute/relative), required naming conventions, or trailing slash expectations.

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 directory' is a clear verb+resource, indicating the tool's primary function. It distinguishes from sibling file operations like copy_file, move_file, delete_file, write_file, etc., which have different purposes.

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 (e.g., for creating new directories) versus alternatives (e.g., write_file for files, copy_file for copying). There is no mention of prerequisites or exclusions.

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/FutureAtoms/agentic-control-framework'

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