Skip to main content
Glama

create_folder

Create a new folder in a Jira project for organizing test cases, plans, or cycles within Zephyr Scale Cloud.

Instructions

Create a new folder in a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the folder to create
projectKeyYesJira project key where the folder will be created
parentFolderIdNoOptional parent folder ID to create a subfolder
folderTypeNoFolder type (default: TEST_CASE)TEST_CASE

Implementation Reference

  • Main handler function for the 'create_folder' MCP tool. Validates inputs, calls ZephyrClient.createFolder, and returns formatted response.
    async function createFolder(args) {
      try {
        const { name, projectKey, parentFolderId, folderType } = args;
    
        if (!name) {
          throw new Error('folder name is required');
        }
    
        if (!projectKey) {
          throw new Error('projectKey is required');
        }
    
        if (!config.projectKeyPattern.test(projectKey)) {
          throw new Error('Invalid projectKey format. Must match pattern: [A-Z][A-Z_0-9]+');
        }
    
        // Validate folderType against allowed enum values
        const validFolderTypes = ['TEST_CASE', 'TEST_PLAN', 'TEST_CYCLE'];
        const selectedFolderType = folderType || 'TEST_CASE';
    
        if (!validFolderTypes.includes(selectedFolderType)) {
          throw new Error(`folderType must be one of: ${validFolderTypes.join(', ')}`);
        }
    
        const folderData = {
          name,
          projectKey,
          folderType: selectedFolderType
        };
    
        if (parentFolderId) {
          if (!config.folderIdPattern.test(parentFolderId)) {
            throw new Error('Invalid parentFolderId format. Must be a numeric ID.');
          }
          folderData.parentId = parseInt(parentFolderId);
        }
    
        const result = await client.createFolder(folderData);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                message: 'Folder created successfully',
                folder: result
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: formatError(error, 'creating folder')
            }
          ],
          isError: true
        };
      }
    }
  • Registration object for 'create_folder' tool in folderTools array, including name, description, inputSchema, and handler reference. This array is spread into allTools in index.js for MCP server.
    {
      name: 'create_folder',
      description: 'Create a new folder in a project',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the folder to create',
            minLength: 1,
            maxLength: 255
          },
          projectKey: {
            type: 'string',
            description: 'Jira project key where the folder will be created',
            pattern: config.projectKeyPattern.source
          },
          parentFolderId: {
            type: 'string',
            description: 'Optional parent folder ID to create a subfolder',
            pattern: config.folderIdPattern.source
          },
          folderType: {
            type: 'string',
            description: 'Folder type (default: TEST_CASE)',
            enum: ['TEST_CASE', 'TEST_PLAN', 'TEST_CYCLE'],
            default: 'TEST_CASE'
          }
        },
        required: ['name', 'projectKey']
      },
      handler: createFolder
    }
  • Input schema for 'create_folder' tool defining parameters with types, descriptions, constraints (patterns, enums, required).
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Name of the folder to create',
          minLength: 1,
          maxLength: 255
        },
        projectKey: {
          type: 'string',
          description: 'Jira project key where the folder will be created',
          pattern: config.projectKeyPattern.source
        },
        parentFolderId: {
          type: 'string',
          description: 'Optional parent folder ID to create a subfolder',
          pattern: config.folderIdPattern.source
        },
        folderType: {
          type: 'string',
          description: 'Folder type (default: TEST_CASE)',
          enum: ['TEST_CASE', 'TEST_PLAN', 'TEST_CYCLE'],
          default: 'TEST_CASE'
        }
      },
      required: ['name', 'projectKey']
    },
  • ZephyrClient helper method implementing the API call to create a folder via POST /folders.
    async createFolder(folderData) {
      return this.request('POST', '/folders', folderData);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is a creation tool, implying a write/mutation operation, but doesn't disclose any behavioral traits like required permissions, whether folder names must be unique, what happens on conflicts, rate limits, or what the response contains (no output schema). This leaves significant gaps for an agent to use it safely and effectively.

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, clear sentence that directly states the tool's purpose without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly. Every word earns its place.

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 complexity (a write operation with 4 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like error handling, permissions, or response format, which are crucial for an agent to use this tool effectively in context. The schema covers parameters well, but the overall tool context is underspecified.

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 description coverage is 100%, so all parameters are well-documented in the schema itself. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain the relationship between 'projectKey' and 'parentFolderId', or clarify 'folderType' usage). With high schema coverage, the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 a project'), making the purpose immediately understandable. However, it doesn't differentiate this tool from sibling tools like 'list_folders' or 'get_folder' beyond the creation aspect, nor does it specify what type of project system this is (Jira is only hinted at in the schema).

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 an existing project), when not to use it (e.g., for updating folders), or refer to sibling tools like 'list_folders' for checking existing folders first. Usage is implied but not explicitly stated.

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/donyfs/mcp-zephyr'

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