submit-test-results
Submit manual test execution results to track test run outcomes in QA Studio. Use this tool to record test case statuses including passed, failed, skipped, or blocked.
Instructions
Submit test results for a test run (useful for manual test execution tracking)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The project ID | |
| testRunId | Yes | The test run ID | |
| results | Yes | Array of test results |
Implementation Reference
- src/index.ts:360-394 (handler)The handler function for the 'submit-test-results' tool. It destructures input arguments, sends a POST request to the `/results` API with mapped test results data (projectId to projectName), and returns formatted success or error response.async (args) => { try { const { projectId, testRunId, results } = args; const data = await apiRequest(`/results`, { method: 'POST', body: JSON.stringify({ testRunId, results: results.map((r) => ({ ...r, projectName: projectId // Map to expected field })) }) }); return { content: [ { type: 'text' as const, text: `✅ Submitted ${results.length} test results!\n\nProcessed: ${data.processedCount}\nDuplicates: ${data.duplicatesSkipped}\nErrors: ${data.errors.length}` } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Error: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
- src/index.ts:338-358 (schema)Zod input schema for the tool, validating projectId, testRunId, and an array of test results each with title, status (passed/failed/skipped/blocked), optional duration and error object.inputSchema: { projectId: z.string().describe('The project ID'), testRunId: z.string().describe('The test run ID'), results: z .array( z.object({ title: z.string().describe('Test case title'), status: z .enum(['passed', 'failed', 'skipped', 'blocked']) .describe('Test result status'), duration: z.number().optional().describe('Duration in milliseconds'), error: z .object({ message: z.string(), stack: z.string().optional() }) .optional() }) ) .describe('Array of test results') }
- src/index.ts:333-395 (registration)Full registration of the 'submit-test-results' tool on the MCP server, specifying name, description, input schema, and inline handler function.// Register tool: submit-test-results server.registerTool( 'submit-test-results', { description: 'Submit test results for a test run (useful for manual test execution tracking)', inputSchema: { projectId: z.string().describe('The project ID'), testRunId: z.string().describe('The test run ID'), results: z .array( z.object({ title: z.string().describe('Test case title'), status: z .enum(['passed', 'failed', 'skipped', 'blocked']) .describe('Test result status'), duration: z.number().optional().describe('Duration in milliseconds'), error: z .object({ message: z.string(), stack: z.string().optional() }) .optional() }) ) .describe('Array of test results') } }, async (args) => { try { const { projectId, testRunId, results } = args; const data = await apiRequest(`/results`, { method: 'POST', body: JSON.stringify({ testRunId, results: results.map((r) => ({ ...r, projectName: projectId // Map to expected field })) }) }); return { content: [ { type: 'text' as const, text: `✅ Submitted ${results.length} test results!\n\nProcessed: ${data.processedCount}\nDuplicates: ${data.duplicatesSkipped}\nErrors: ${data.errors.length}` } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Error: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );