list_run_test_cases
Retrieve per-case execution records from a manual run. Filter by assignee or result to obtain the rtcRef required for updating test cases.
Instructions
Get the per-case execution records inside a manual run — what the UI shows as rows in the run's test-case table. Each row carries the test case identity (caseKey like 'TC-156', title), the current assignee, and the current result/status ('untested', 'passed', 'failed', etc.). Filter by assignee (email or User _id) or result/status. Use this before update_run_test_case so you have the rtcRef for each case you want to update.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID (required). | |
| runId | Yes | Internal run _id or counter-style ID e.g. 'RUN-12' (required). | |
| search | No | Match by case title or caseKey. | |
| assignee | No | Filter by assignee — User _id OR email (server resolves email). | |
| result | No | Filter by result/status. Display ('Passed') or canonical ('passed') form. | |
| status | No | Alias for result. | |
| sortBy | No | ||
| sortOrder | No | ||
| page | No | ||
| limit | No | Default 25 (max 200). |
Implementation Reference
- The handler function that executes the 'list_run_test_cases' tool logic. It validates inputs (projectId, runId required), calls the API endpoint, and returns JSON response.
export async function handleListRunTestCases(args?: ListRunTestCasesArgs) { const token = getApiKey(args); if (!token) { throw new Error( "Missing TESTDINO_PAT environment variable. Configure it in your .cursor/mcp.json under 'env'." ); } if (!args?.projectId) throw new Error("projectId is required"); if (!args?.runId) throw new Error("runId is required"); try { const url = endpoints.listRunTestCases(args); const response = await apiRequestJson<unknown>(url, { headers: { Authorization: `Bearer ${token}` }, }); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); throw new Error(`Failed to list run test cases: ${msg}`); } } - TypeScript interface defining input arguments for the list_run_test_cases tool (projectId, runId, search, assignee, result, status, sortBy, sortOrder, page, limit).
interface ListRunTestCasesArgs { projectId: string; runId: string; search?: string; assignee?: string; result?: string; status?: string; sortBy?: "createdAt" | "updatedAt" | "status" | "caseKey"; sortOrder?: "asc" | "desc"; page?: number; limit?: number; } - Tool definition object with name 'list_run_test_cases', description, and JSON Schema inputSchema for parameter validation.
export const listRunTestCasesTool = { name: "list_run_test_cases", description: "Get the per-case execution records inside a manual run — what the UI shows as rows in the run's test-case table. Each row carries the test case identity (caseKey like 'TC-156', title), the current assignee, and the current result/status ('untested', 'passed', 'failed', etc.). Filter by assignee (email or User _id) or result/status. Use this before update_run_test_case so you have the rtcRef for each case you want to update.", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "Project ID (required)." }, runId: { type: "string", description: "Internal run _id or counter-style ID e.g. 'RUN-12' (required).", }, search: { type: "string", description: "Match by case title or caseKey.", }, assignee: { type: "string", description: "Filter by assignee — User _id OR email (server resolves email).", }, result: { type: "string", description: "Filter by result/status. Display ('Passed') or canonical ('passed') form.", }, status: { type: "string", description: "Alias for result." }, sortBy: { type: "string", enum: ["createdAt", "updatedAt", "status", "caseKey"], }, sortOrder: { type: "string", enum: ["asc", "desc"] }, page: { type: "number" }, limit: { type: "number", description: "Default 25 (max 200)." }, }, required: ["projectId", "runId"], }, }; - src/index.ts:123-130 (registration)Tool is registered in the MCP server tool list (listRunTestCasesTool added to the tools array).
listRunTestCasesTool, updateRunTestCaseTool, // Sessions listSessionsTool, getSessionTool, createSessionTool, updateSessionTool, ]; - src/index.ts:316-319 (registration)Request handler routing: when tool name is 'list_run_test_cases', it calls handleListRunTestCases.
if (name === "list_run_test_cases") { return await handleListRunTestCases( args as Parameters<typeof handleListRunTestCases>[0] ); - src/lib/endpoints.ts:436-452 (helper)Endpoint URL builder for list_run_test_cases, constructing GET /api/mcp/manual-runs/:projectId/:runId/test-cases with query parameters.
listRunTestCases: (params: { projectId: string; runId: string; search?: string; assignee?: string; result?: string; status?: string; sortBy?: string; sortOrder?: string; page?: number; limit?: number; }): string => { const baseUrl = getBaseUrl(); const { projectId, runId, ...queryParams } = params; const queryString = buildQueryString(queryParams); return `${baseUrl}/api/mcp/manual-runs/${projectId}/${runId}/test-cases${queryString}`; },