Skip to main content
Glama

get_root_suites

Retrieve top-level test suites without parent structures from a Zebrunner project to organize and manage test cases effectively.

Instructions

🌳 Get root suites (suites with no parent) from project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_keyYesProject key (e.g., 'android' or 'ANDROID')
formatNoOutput formatjson

Implementation Reference

  • The primary handler method in ZebrunnerToolHandlers class that implements the get_root_suites tool logic: fetches root suites from API client, enriches with hierarchy information, formats the output, and returns MCP-compatible content response.
    async getRootSuites(projectKey: string, format: OutputFormat = 'json') {
      try {
        const rootSuites = await this.client.getRootSuites(projectKey);
        const enrichedSuites = HierarchyProcessor.enrichSuitesWithHierarchy(rootSuites);
        const formattedData = FormatProcessor.format(enrichedSuites, format);
        
        return {
          content: [
            {
              type: "text" as const,
              text: typeof formattedData === 'string' ? formattedData : JSON.stringify(formattedData, null, 2)
            }
          ]
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Error retrieving root suites: ${error.message}`
            }
          ]
        };
      }
  • MCP server tool registration for 'get_root_suites', including inline Zod input schema validation and handler invocation.
    server.tool(
      "get_root_suites",
      "Get only root-level test suites with hierarchy information",
      {
        projectKey: z.string().min(1),
        format: z.enum(['dto', 'json', 'string']).default('json')
      },
      async (args) => toolHandlers.getRootSuites(args.projectKey, args.format)
    );
  • Inline Zod schema defining input parameters for get_root_suites tool: projectKey (required string) and format (optional enum).
      projectKey: z.string().min(1),
      format: z.enum(['dto', 'json', 'string']).default('json')
    },
  • API client helper method that retrieves all test suites and filters to root-level ones (no parentSuiteId), called by the main handler.
    async getRootSuites(projectKey: string): Promise<ZebrunnerTestSuite[]> {
      const allSuites = await this.getAllTestSuites(projectKey);
      return allSuites.filter(suite => !suite.parentSuiteId);
    }

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