Skip to main content
Glama

list_folders

Retrieve folder structures in Jira projects to organize test management workflows, supporting pagination and subfolder navigation.

Instructions

List folders in a project or specific folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyNoJira project key to filter folders
folderIdNoParent folder ID to list subfolders
maxResultsNoMaximum number of results to return (default: 50, max: 1000)
startAtNoStarting position for pagination (default: 0)

Implementation Reference

  • The main handler function for the 'list_folders' tool. It constructs parameters from args, calls ZephyrClient.getFolders, formats the response as JSON text content, and handles errors using formatError.
    async function listFolders(args) {
      try {
        const params = {
          projectKey: args.projectKey,
          folderId: args.folderId,
          maxResults: args.maxResults || config.defaultMaxResults,
          startAt: args.startAt || 0
        };
    
        const response = await client.getFolders(params);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                folders: response.values || response,
                total: response.total || response.length,
                startAt: response.startAt || 0,
                maxResults: response.maxResults || params.maxResults
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: formatError(error, 'fetching folders')
            }
          ],
          isError: true
        };
      }
    }
  • Input schema for the 'list_folders' tool, defining properties for projectKey, folderId, maxResults, and startAt with types, descriptions, patterns, and defaults.
    inputSchema: {
      type: 'object',
      properties: {
        projectKey: {
          type: 'string',
          description: 'Jira project key to filter folders',
          pattern: config.projectKeyPattern.source
        },
        folderId: {
          type: 'string',
          description: 'Parent folder ID to list subfolders',
          pattern: config.folderIdPattern.source
        },
        maxResults: {
          type: 'number',
          description: 'Maximum number of results to return (default: 50, max: 1000)',
          minimum: 1,
          maximum: config.maxMaxResults,
          default: config.defaultMaxResults
        },
        startAt: {
          type: 'number',
          description: 'Starting position for pagination (default: 0)',
          minimum: 0,
          default: 0
        }
      }
    },
  • The tool registration object for 'list_folders' exported as part of folderTools array, which is included in the main allTools array used by the MCP server for dynamic tool dispatching.
    {
      name: 'list_folders',
      description: 'List folders in a project or specific folder',
      inputSchema: {
        type: 'object',
        properties: {
          projectKey: {
            type: 'string',
            description: 'Jira project key to filter folders',
            pattern: config.projectKeyPattern.source
          },
          folderId: {
            type: 'string',
            description: 'Parent folder ID to list subfolders',
            pattern: config.folderIdPattern.source
          },
          maxResults: {
            type: 'number',
            description: 'Maximum number of results to return (default: 50, max: 1000)',
            minimum: 1,
            maximum: config.maxMaxResults,
            default: config.defaultMaxResults
          },
          startAt: {
            type: 'number',
            description: 'Starting position for pagination (default: 0)',
            minimum: 0,
            default: 0
          }
        }
      },
      handler: listFolders
    },

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