Skip to main content
Glama

get_suite_hierarchy

Retrieve hierarchical test suite tree structure with configurable depth for Zebrunner project test organization and navigation.

Instructions

🌳 Get hierarchical test suite tree with configurable depth

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput formatjson
include_clickable_linksNoInclude clickable links to Zebrunner web UI
max_depthNoMaximum tree depth
project_keyYesProject key
root_suite_idNoStart from specific root suite

Implementation Reference

  • Core implementation of the get_suite_hierarchy tool handler in ZebrunnerToolHandlers class. Fetches suites via API client, processes hierarchy using HierarchyProcessor, applies depth limit, formats output.
    async getSuiteHierarchy(input: z.infer<typeof GetSuiteHierarchyInputSchema>) { const { projectKey, rootSuiteId, maxDepth, format } = input; try { const allSuites = await this.client.getAllTestSuites(projectKey); let suitesToProcess = allSuites; // Filter by root suite if specified if (rootSuiteId) { const descendants = HierarchyProcessor.getSuiteDescendants(rootSuiteId, allSuites); const rootSuite = allSuites.find(s => s.id === rootSuiteId); suitesToProcess = rootSuite ? [rootSuite, ...descendants] : descendants; } // Build hierarchical tree const hierarchyTree = HierarchyProcessor.buildSuiteTree(suitesToProcess); // Limit depth if specified const limitDepth = (suites: any[], currentDepth: number): any[] => { if (currentDepth >= maxDepth) { return suites.map(suite => ({ ...suite, children: [] })); } return suites.map(suite => ({ ...suite, children: suite.children ? limitDepth(suite.children, currentDepth + 1) : [] })); }; const limitedTree = limitDepth(hierarchyTree, 0); const formattedData = FormatProcessor.format(limitedTree, 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 suite hierarchy: ${error.message}` } ] }; } }
  • Zod input schema defining parameters for the get_suite_hierarchy tool: projectKey (required), rootSuiteId (optional), maxDepth (default 5), format.
    export const GetSuiteHierarchyInputSchema = z.object({ projectKey: z.string().min(1), rootSuiteId: z.number().int().positive().optional(), maxDepth: z.number().int().positive().max(10).default(5), format: z.enum(['dto', 'json', 'string']).default('json') });
  • MCP server tool registration for get_suite_hierarchy, linking name, description, input schema, and handler execution.
    server.tool( "get_suite_hierarchy", "Get hierarchical test suite tree with configurable depth", { projectKey: z.string().min(1), rootSuiteId: z.number().int().positive().optional(), maxDepth: z.number().int().positive().max(10).default(5), format: z.enum(['dto', 'json', 'string']).default('json') }, async (args) => toolHandlers.getSuiteHierarchy(args) );

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