Skip to main content
Glama

get_all_tcm_test_cases_by_project

Retrieve all test cases for a specific project from Zebrunner Test Case Management with configurable output formats and pagination controls.

Instructions

📋 Get ALL TCM test cases by project using comprehensive pagination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_keyYesProject key (e.g., 'android' or 'ANDROID')
formatNoOutput formatjson
include_clickable_linksNoInclude clickable links to Zebrunner web UI
max_resultsNoMaximum number of results (configurable limit for performance)

Implementation Reference

  • Main handler implementation for retrieving all TCM test cases by project using paginated API calls to /test-cases endpoint with token-based pagination. Collects all pages until no nextPageToken.
    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;
    }

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/maksimsarychau/mcp-zebrunner'

If you have feedback or need assistance with the MCP directory API, please join our Discord server