get_folder
Retrieve detailed information about a specific folder in Zephyr Scale Cloud test management, including its structure and contents, by providing the folder ID.
Instructions
Get detailed information about a specific folder
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folderId | Yes | Folder ID to retrieve |
Implementation Reference
- src/tools/folder-tools.js:54-86 (handler)The main handler function for the 'get_folder' tool. Validates the folderId input, fetches the folder using ZephyrClient.getFolder, and returns formatted JSON or error response.async function getFolder(args) { try { const { folderId } = args; if (!folderId) { throw new Error('folderId is required'); } if (!config.folderIdPattern.test(folderId)) { throw new Error('Invalid folderId format. Must be a numeric ID.'); } const folder = await client.getFolder(folderId); return { content: [ { type: 'text', text: JSON.stringify(folder, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: formatError(error, `fetching folder ${args.folderId}`) } ], isError: true }; } }
- src/tools/folder-tools.js:191-201 (schema)Input schema definition for the 'get_folder' tool, specifying folderId as required string with pattern validation.inputSchema: { type: 'object', properties: { folderId: { type: 'string', description: 'Folder ID to retrieve', pattern: config.folderIdPattern.source } }, required: ['folderId'] },
- src/tools/folder-tools.js:188-203 (registration)Tool registration object defining name 'get_folder', description, inputSchema, and handler reference. Part of the folderTools export array.{ name: 'get_folder', description: 'Get detailed information about a specific folder', inputSchema: { type: 'object', properties: { folderId: { type: 'string', description: 'Folder ID to retrieve', pattern: config.folderIdPattern.source } }, required: ['folderId'] }, handler: getFolder },
- src/index.js:30-37 (registration)Central registration where folderTools (including 'get_folder') are spread into allTools array used for dynamic tool lookup and execution in MCP server.const allTools = [ ...projectTools, ...folderTools, ...testCaseTools, ...testStepsTools, ...testScriptTools, ...referenceDataTools ];
- src/zephyr-client.js:115-117 (helper)ZephyrClient helper method that makes the API request to retrieve a specific folder by ID.async getFolder(folderId) { return this.request('GET', `/folders/${folderId}`); }