list_test_suites
Retrieve test suites for a specific project in Zebrunner Test Case Management, supporting pagination and multiple output formats to organize testing workflows.
Instructions
📋 List test suites for a project (✅ Verified Working)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Output format | json |
| include_clickable_links | No | Include clickable links to Zebrunner web UI | |
| include_hierarchy | No | Include hierarchy information | |
| page | No | Page number (0-based) | |
| page_token | No | Page token for pagination | |
| project_id | No | Project ID (alternative to project_key) | |
| project_key | Yes | Project key (e.g., 'android' or 'ANDROID') | |
| size | No | Page size (configurable via MAX_PAGE_SIZE env var) |
Implementation Reference
- src/index.ts:136-147 (handler)The core handler function that implements the logic for the 'list_test_suites' MCP tool, including input validation, API call, output parsing, and response formatting.async (args) => { const { project_key, project_id } = args; if (!project_key && !project_id) { throw new Error("Either project_key or project_id must be provided"); } const suites = await client.listTestSuites({ projectKey: project_key, projectId: project_id }); const data = suites.map((s: unknown) => { const parsed = TestSuiteSchema.safeParse(s); return parsed.success ? parsed.data : s; }); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; }
- src/index.ts:130-148 (registration)Registration of the 'list_test_suites' tool with MCP server, including name, description, input schema, and handler."list_test_suites", "Return list of Zebrunner test suites for a project (requires project_key or project_id)", { project_key: z.string().optional(), project_id: z.number().int().positive().optional() }, async (args) => { const { project_key, project_id } = args; if (!project_key && !project_id) { throw new Error("Either project_key or project_id must be provided"); } const suites = await client.listTestSuites({ projectKey: project_key, projectId: project_id }); const data = suites.map((s: unknown) => { const parsed = TestSuiteSchema.safeParse(s); return parsed.success ? parsed.data : s; }); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );
- src/types.ts:8-13 (schema)Zod schema for input parameters of the list_test_suites tool (project_key or project_id required).export const ListTestSuitesSchema = z.object({ project_key: z.string().optional(), project_id: z.number().int().positive().optional() }).refine(data => data.project_key || data.project_id, { message: "Either project_key or project_id must be provided" });
- src/zebrunnerClient.ts:48-55 (helper)ZebrunnerClient helper method that makes the HTTP request to fetch test suites from the Zebrunner API.async listTestSuites(params: TestSuiteParams): Promise<any[]> { const { projectKey, projectId } = params; const res = await this.http.get("/test-suites", { params: { projectKey, projectId } }); // API returns {items: [], _meta: {}} structure return Array.isArray(res.data) ? res.data : (res.data?.items || []); }