get_all_tcm_test_cases_by_project
Retrieve all test cases from a specific Zebrunner project with configurable output formats and pagination for comprehensive test management.
Instructions
📋 Get ALL TCM test cases by project using comprehensive pagination
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format | json |
| include_clickable_links | No | Include clickable links to Zebrunner web UI | |
| max_results | No | Maximum number of results (configurable limit for performance) | |
| project_key | Yes | Project key (e.g., 'android' or 'ANDROID') |
Implementation Reference
- src/api/enhanced-client.ts:668-722 (helper)Core helper function implementing the logic to retrieve ALL test cases (TCM) for a given project using robust token-based pagination with safety limits. This matches the functionality expected for the tool 'get_all_tcm_test_cases_by_project'. No direct MCP registration found for this exact tool name, but this is the precise implementation./** * Get all TCM test cases for a project using pagination (Java implementation approach) * This method fetches ALL test cases from the project using proper token-based pagination */ async getAllTCMTestCasesByProject(projectKey: string): Promise<ZebrunnerShortTestCase[]> { const allItems: ZebrunnerShortTestCase[] = []; let nextPageToken: string | undefined = undefined; let hasMore = true; let pageCount = 0; while (hasMore && pageCount < 1000) { // Safety limit // Direct API call to avoid circular dependency with getTestCases const params: any = { projectKey, maxPageSize: 100 // Use maximum allowed page size }; if (nextPageToken) { params.pageToken = nextPageToken; } const response = await this.retryRequest(async () => { const apiResponse = await this.http.get('/test-cases', { params }); const data = apiResponse.data; if (Array.isArray(data)) { return { items: data.map(item => ZebrunnerShortTestCaseSchema.parse(item)) }; } else if (data.items) { return { items: data.items.map((item: any) => ZebrunnerShortTestCaseSchema.parse(item)), _meta: data._meta }; } return { items: [] }; }); allItems.push(...response.items); // Check for next page token in metadata nextPageToken = response._meta?.nextPageToken; hasMore = !!nextPageToken; // Stop only when nextPageToken is null pageCount++; if (this.config.debug) { console.error(`📄 [TestCases] Fetched page ${pageCount}: ${response.items.length} test cases (total: ${allItems.length})`); } } if (pageCount >= 1000) { console.error('⚠️ [TestCases] Stopped pagination after 1000 pages to prevent infinite loop'); } return allItems; }