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
| Name | Required | Description | Default |
|---|---|---|---|
| projectKey | No | Jira project key to filter folders | |
| folderId | No | Parent folder ID to list subfolders | |
| maxResults | No | Maximum number of results to return (default: 50, max: 1000) | |
| startAt | No | Starting position for pagination (default: 0) |
Implementation Reference
- src/tools/folder-tools.js:14-49 (handler)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 }; } }
- src/tools/folder-tools.js:158-185 (schema)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 } } },
- src/tools/folder-tools.js:155-187 (registration)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 },