Skip to main content
Glama

list_test_cases

Retrieve test cases from Zephyr Scale Cloud with filtering options for projects, folders, and pagination to manage testing workflows.

Instructions

List test cases with optional filtering by project and folder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectKeyNoJira project key to filter test cases
folderIdNoFolder ID to filter test cases
maxResultsNoMaximum number of results to return (default: 50, max: 1000)
startAtNoStarting position for pagination (default: 0)

Implementation Reference

  • The handler function that executes the list_test_cases tool. It validates input parameters, fetches test cases from ZephyrClient, formats the JSON response, and handles errors appropriately.
    async function listTestCases(args) { try { const params = { projectKey: args.projectKey, folderId: args.folderId, maxResults: args.maxResults || config.defaultMaxResults, startAt: args.startAt || 0 }; // Validate projectKey if provided if (params.projectKey && !config.projectKeyPattern.test(params.projectKey)) { throw new Error('Invalid projectKey format. Must match pattern: [A-Z][A-Z_0-9]+'); } // Validate folderId if provided if (params.folderId && (!Number.isInteger(params.folderId) || params.folderId < 1)) { throw new Error('Invalid folderId format. Must be a positive integer.'); } const response = await client.getTestCases(params); return { content: [ { type: 'text', text: JSON.stringify({ testCases: 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 test cases') } ], isError: true }; } }
  • The inputSchema defining the expected parameters for the list_test_cases tool, including types, descriptions, patterns, defaults, and constraints.
    inputSchema: { type: 'object', properties: { projectKey: { type: 'string', description: 'Jira project key to filter test cases', pattern: config.projectKeyPattern.source }, folderId: { type: 'integer', description: 'Folder ID to filter test cases', minimum: 1 }, 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 } } },
  • Local registration of the tool within the testCaseTools array exported from this module.
    { name: 'list_test_cases', description: 'List test cases with optional filtering by project and folder', inputSchema: { type: 'object', properties: { projectKey: { type: 'string', description: 'Jira project key to filter test cases', pattern: config.projectKeyPattern.source }, folderId: { type: 'integer', description: 'Folder ID to filter test cases', minimum: 1 }, 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: listTestCases },
  • src/index.js:30-37 (registration)
    Global registration by including testCaseTools in the allTools array, which is used for MCP tool listing and dynamic dispatch.
    const allTools = [ ...projectTools, ...folderTools, ...testCaseTools, ...testStepsTools, ...testScriptTools, ...referenceDataTools ];

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