get_root_suites
Retrieve root test suites (those without parent suites) from a specified project in Zebrunner Test Case Management to organize and manage test case hierarchies.
Instructions
🌳 Get root suites (suites with no parent) from project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format | json |
| project_key | Yes | Project key (e.g., 'android' or 'ANDROID') |
Implementation Reference
- src/handlers/tools.ts:314-338 (handler)Main handler function for the 'get_root_suites' tool. Fetches root suites using the client, enriches them with hierarchy information using HierarchyProcessor, formats the output, and returns it as MCP content block.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}` } ] }; } }
- src/index-enhanced.ts:145-153 (registration)MCP server tool registration for 'get_root_suites', including input schema validation with Zod 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) );
- src/index-enhanced.ts:148-151 (schema)Input schema definition for the 'get_root_suites' tool using Zod: projectKey (required string) and format (optional enum: 'dto', 'json', 'string', default 'json').{ projectKey: z.string().min(1), format: z.enum(['dto', 'json', 'string']).default('json') },
- src/api/client.ts:438-441 (helper)API client helper method that retrieves all test suites for a project and filters to return only root-level suites (those without a parentSuiteId).async getRootSuites(projectKey: string): Promise<ZebrunnerTestSuite[]> { const allSuites = await this.getAllTestSuites(projectKey); return allSuites.filter(suite => !suite.parentSuiteId); }