Skip to main content
Glama
martin-1103
by martin-1103

create_folder

Create a new folder in your GASSAPI project to organize API endpoints, environments, and testing workflows with specified name and optional parent folder structure.

Instructions

Create a new folder in the project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesFolder name
descriptionNoFolder description
parentIdNoParent folder ID (optional, creates root-level folder if not provided)
projectIdNoProject ID (optional, will use current project if not provided)

Implementation Reference

  • Core handler function that executes the create_folder tool logic: validates arguments, initializes config and backend client, creates FolderService instance, calls backend API to create folder, handles errors, and returns standardized MCP tool response.
    export async function handleCreateFolder(args: any): Promise<McpToolResponse> {
      try {
        const { name, description, parentId, projectId } = args;
    
        if (!name) {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  success: false,
                  error: 'Folder name is required'
                }, null, 2)
              }
            ]
          };
        }
    
        const instances = await getInstances();
    
        // Get project ID if not provided
        let targetProjectId = projectId;
        if (!targetProjectId) {
          const config = await instances.configManager.detectProjectConfig();
          targetProjectId = config?.project?.id;
          if (!targetProjectId) {
            return {
              content: [
                {
                  type: 'text',
                  text: JSON.stringify({
                    success: false,
                    error: 'Project ID not found in config and not provided in arguments'
                  }, null, 2)
                }
              ]
            };
          }
        }
    
        // Create folder service
        const folderService = new FolderService(
          instances.backendClient.getBaseUrl(),
          instances.backendClient.getToken()
        );
    
        // Create folder
        const createRequest: CreateFolderRequest = {
          name: name.trim(),
          description: description?.trim(),
          parentId,
          projectId: targetProjectId
        };
    
        const response = await folderService.createFolder(createRequest);
    
        if (!response.success) {
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify({
                  success: false,
                  error: response.error || 'Failed to create folder'
                }, null, 2)
              }
            ]
          };
        }
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: true,
                data: response.data,
                message: 'Folder created successfully'
              }, null, 2)
            }
          ]
        };
    
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: false,
                error: error.message || 'Unknown error occurred while creating folder'
              }, null, 2)
            }
          ]
        };
      }
  • Defines the MCP tool schema for 'create_folder' including input validation schema with required 'name' field and optional description, parentId, projectId.
    export const createFolderTool: McpTool = {
      name: 'create_folder',
      description: 'Create a new folder in the project',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Folder name'
          },
          description: {
            type: 'string',
            description: 'Folder description'
          },
          parentId: {
            type: 'string',
            description: 'Parent folder ID (optional, creates root-level folder if not provided)'
          },
          projectId: {
            type: 'string',
            description: 'Project ID (optional, will use current project if not provided)'
          }
        },
        required: ['name']
      },
      handler: handleCreateFolder
    };
  • Registers the create_folder handler wrapper that dynamically imports and delegates to the core handleCreateFolder function. This function is spread into the main tool handlers registry.
    function createFolderToolHandlers(): Record<string, (args: any) => Promise<McpToolResponse>> {
      return {
        'list_folders': async (args: any) => {
          const { handleListFolders } = await import('./folders/handlers/folderHandlers.js');
          return handleListFolders(args);
        },
        'create_folder': async (args: any) => {
          const { handleCreateFolder } = await import('./folders/handlers/folderHandlers.js');
          return handleCreateFolder(args);
        },
        'update_folder': async (args: any) => {
          const { handleUpdateFolder } = await import('./folders/handlers/folderHandlers.js');
          return handleUpdateFolder(args);
        },
        'move_folder': async (args: any) => {
          const { handleMoveFolder } = await import('./folders/handlers/folderHandlers.js');
          return handleMoveFolder(args);
        },
        'delete_folder': async (args: any) => {
          const { handleDeleteFolder } = await import('./folders/handlers/folderHandlers.js');
          return handleDeleteFolder(args);
        },
        'get_folder_details': async (args: any) => {
          const { handleGetFolderDetails } = await import('./folders/handlers/folderHandlers.js');
          return handleGetFolderDetails(args);
        }
      };
    }
  • Main tools registry array that includes folderTools (containing create_folder tool definition) among all available MCP tools.
    export const ALL_TOOLS: McpTool[] = [
      ...CORE_TOOLS,
      ...AUTH_TOOLS,
      ...environmentTools,
      ...folderTools,
      ...ENDPOINT_TOOLS,
      ...testingTools,
      ...flowTools
    ];
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a creation tool, implying a write operation, but doesn't cover permissions, error conditions, rate limits, or what happens on success (e.g., returns a folder ID). This is inadequate for a mutation tool with zero annotation coverage.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and wastes no space, making it easy for an agent to parse quickly.

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 tool is a mutation (folder creation) with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, potential side effects, or error handling, which are critical for an agent to use it effectively in a project context.

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 input schema has 100% description coverage, clearly documenting all four parameters. The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline score of 3 without compensating value.

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 action ('Create') and resource ('new folder in the project'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'create_flow' or 'create_environment' beyond the resource type, which prevents a perfect score.

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. It doesn't mention prerequisites (e.g., needing a project), exclusions (e.g., when not to create folders), or comparisons to related tools like 'update_folder' or 'delete_folder', leaving the agent with minimal context for decision-making.

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/martin-1103/mcp2'

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