Delete Test Case
delete_test_caseDisable a test case by UUID, hiding it from default queries without permanent removal.
Instructions
Disable (soft-delete) a test case. The test is hidden from default list queries but not permanently removed. Requires testUuid. Returns {deleted: true, testUuid}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testUuid | Yes | UUID of the test case to delete. Required. |
Implementation Reference
- handlers/deleteTestCaseHandler.ts:9-26 (handler)The actual handler function that executes the 'delete_test_case' tool logic. It calls client.disableTestCase(input.testUuid) to soft-delete a test case and returns {deleted: true, testUuid}.
export async function deleteTestCaseHandler( input: DeleteTestCaseInput, _context: ToolContext, ): Promise<ToolResponse> { const start = Date.now(); logger.toolStart('delete_test_case', input); try { const client = new DebuggAIServerClient(config.api.key); await client.init(); await client.disableTestCase(input.testUuid); logger.toolComplete('delete_test_case', Date.now() - start); return { content: [{ type: 'text', text: JSON.stringify({ deleted: true, testUuid: input.testUuid }, null, 2) }] }; } catch (error) { logger.toolError('delete_test_case', error as Error, Date.now() - start); throw handleExternalServiceError(error, 'DebuggAI', 'delete_test_case'); } } - tools/testSuiteTools.ts:157-171 (schema)Builds the 'delete_test_case' Tool object including its inputSchema (requires testUuid string). This defines the schema used for the unvalidated tool registration.
export function buildDeleteTestCaseTool(): Tool { return { name: 'delete_test_case', title: 'Delete Test Case', description: 'Disable (soft-delete) a test case. The test is hidden from default list queries but not permanently removed. Requires testUuid. Returns {deleted: true, testUuid}.', inputSchema: { type: 'object', properties: { testUuid: { type: 'string', description: 'UUID of the test case to delete. Required.' }, }, required: ['testUuid'], additionalProperties: false, }, }; } - types/index.ts:404-408 (schema)Zod schema ('DeleteTestCaseInputSchema') and TypeScript type ('DeleteTestCaseInput') for the delete_test_case input. Validates that testUuid is a valid UUID string.
export const DeleteTestCaseInputSchema = z.object({ testUuid: z.string().uuid(), }).strict(); export type DeleteTestCaseInput = z.infer<typeof DeleteTestCaseInputSchema>; - tools/testSuiteTools.ts:173-175 (registration)Builds the validated version of the tool by combining the base tool definition, the Zod input schema, and the handler function, which gets registered in the tool registry.
export function buildValidatedDeleteTestCaseTool(): ValidatedTool { return { ...buildDeleteTestCaseTool(), inputSchema: DeleteTestCaseInputSchema, handler: deleteTestCaseHandler }; } - services/index.ts:625-629 (helper)The DebuggAIServerClient.disableTestCase() helper method that makes the API POST call to api/v1/e2e-tests/{testUuid}/disable/ to soft-delete the test case.
public async disableTestCase(testUuid: string): Promise<{ uuid: string; isDisabled: boolean }> { if (!this.tx) throw new Error('Client not initialized — call init() first'); await this.tx.post<any>(`api/v1/e2e-tests/${testUuid}/disable/`, {}); return { uuid: testUuid, isDisabled: true }; }