delete_test_case
Remove a test case from Xray test management by specifying its unique key to maintain organized test repositories and eliminate outdated 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)The core handler function that implements the delete_test_case tool logic. It retrieves the test case by key to obtain the internal issueId, then executes a GraphQL deleteTest mutation via the graphqlRequest method.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 (schema)The input schema and tool metadata definition for 'delete_test_case', specifying the required 'testKey' string parameter.{ 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:584-594 (registration)The registration and dispatch handler in the MCP tool call switch statement, which invokes the xrayClient.deleteTestCase method with the provided testKey argument and returns a success message.case 'delete_test_case': { await xrayClient.deleteTestCase(args.testKey as string); return { content: [ { type: 'text', text: `Test case ${args.testKey} deleted successfully`, }, ], }; }