list_test_suites
Retrieve test suites for a specific project in Zebrunner Test Case Management, supporting pagination, hierarchical views, and multiple output formats.
Instructions
๐ List test suites for a project (โ Verified Working)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_key | Yes | Project key (e.g., 'android' or 'ANDROID') | |
| project_id | No | Project ID (alternative to project_key) | |
| format | No | Output format | json |
| include_hierarchy | No | Include hierarchy information | |
| page | No | Page number (0-based) | |
| size | No | Page size (configurable via MAX_PAGE_SIZE env var) | |
| page_token | No | Page token for pagination | |
| include_clickable_links | No | Include clickable links to Zebrunner web UI |
Implementation Reference
- src/index.ts:129-148 (registration)MCP tool registration for 'list_test_suites', including inline input schema validation and execution handler that fetches suites via ZebrunnerClient and returns JSON.server.tool( "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 input schema definition for listTestSuites tool parameters (imported but uses inline equivalent in handler).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)Core API client method implementing the test suites list fetch from Zebrunner API, called by the MCP tool handler.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 || []); }