delete_test_case
Remove test cases from Xray test management system by specifying test case keys to maintain clean test repositories and eliminate obsolete test data.
Instructions
Delete a test case
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testKey | Yes | The test case key to delete (e.g., "PROJ-123") |
Implementation Reference
- src/xray-client.ts:337-352 (handler)Core handler function that implements the delete_test_case tool logic by fetching the test case details and executing a GraphQL deleteTest mutation.async deleteTestCase(testKey: string): Promise<void> { // First, get the issueId from the test key const test = await this.getTestCase(testKey); const mutation = ` mutation DeleteTest($issueId: String!) { deleteTest(issueId: $issueId) } `; const variables = { issueId: test.issueId }; await this.graphqlRequest<{ deleteTest: string }>(mutation, variables); }
- src/index.ts:111-124 (registration)Registration of the 'delete_test_case' tool in the MCP tools array, including name, description, and input schema.{ name: 'delete_test_case', description: 'Delete a test case', inputSchema: { type: 'object', properties: { testKey: { type: 'string', description: 'The test case key to delete (e.g., "PROJ-123")', }, }, required: ['testKey'], }, },
- src/index.ts:114-123 (schema)Input schema definition for the delete_test_case tool, specifying the required 'testKey' parameter.inputSchema: { type: 'object', properties: { testKey: { type: 'string', description: 'The test case key to delete (e.g., "PROJ-123")', }, }, required: ['testKey'], },
- src/index.ts:584-594 (handler)MCP server dispatch handler case for 'delete_test_case' that calls the xrayClient method and returns success response.case 'delete_test_case': { await xrayClient.deleteTestCase(args.testKey as string); return { content: [ { type: 'text', text: `Test case ${args.testKey} deleted successfully`, }, ], }; }