get-test-results
Retrieve test results for a specific test run in QA Studio, with optional filtering by status to analyze performance.
Instructions
Get test results for a specific test run
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The project ID | |
| testRunId | Yes | The test run ID | |
| status | No | Optional filter by status |
Implementation Reference
- src/index.ts:232-259 (handler)Handler function that makes an API request to retrieve test results for a specific test run, optionally filtered by status, and returns the JSON data or an error message.async (args) => { try { const { projectId, testRunId, status } = args; const query = status ? `?status=${status}` : ''; const data = await apiRequest(`/projects/${projectId}/runs/${testRunId}/results${query}`); return { content: [ { type: 'text' as const, text: JSON.stringify(data, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Error: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );
- src/index.ts:221-231 (schema)Tool schema defining the input parameters: projectId, testRunId, and optional status filter using Zod validation.{ description: 'Get test results for a specific test run', inputSchema: { projectId: z.string().describe('The project ID'), testRunId: z.string().describe('The test run ID'), status: z .enum(['passed', 'failed', 'skipped', 'blocked', 'retest', 'untested']) .optional() .describe('Optional filter by status') } },
- src/index.ts:218-259 (registration)Registration of the 'get-test-results' tool using server.registerTool, including schema and inline handler function.// Register tool: get-test-results server.registerTool( 'get-test-results', { description: 'Get test results for a specific test run', inputSchema: { projectId: z.string().describe('The project ID'), testRunId: z.string().describe('The test run ID'), status: z .enum(['passed', 'failed', 'skipped', 'blocked', 'retest', 'untested']) .optional() .describe('Optional filter by status') } }, async (args) => { try { const { projectId, testRunId, status } = args; const query = status ? `?status=${status}` : ''; const data = await apiRequest(`/projects/${projectId}/runs/${testRunId}/results${query}`); return { content: [ { type: 'text' as const, text: JSON.stringify(data, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Error: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );