Update Test Case
update_test_caseUpdate a test case's name, description, or agent task description by providing its UUID. Returns the updated test case.
Instructions
Update a test case's name, description, or agentTaskDescription. Requires testUuid. At least one of name, description, or agentTaskDescription must be provided. Returns the updated test case.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| testUuid | Yes | UUID of the test case to update. Required. | |
| name | No | New name for the test case. | |
| description | No | New description. | |
| agentTaskDescription | No | New agent task description. |
Implementation Reference
- handlers/updateTestCaseHandler.ts:9-31 (handler)The main handler function for update_test_case. Takes UpdateTestCaseInput, calls client.updateTestCase() with testUuid, name, description, and agentTaskDescription, then returns the updated test case as JSON.
export async function updateTestCaseHandler( input: UpdateTestCaseInput, _context: ToolContext, ): Promise<ToolResponse> { const start = Date.now(); logger.toolStart('update_test_case', input); try { const client = new DebuggAIServerClient(config.api.key); await client.init(); const updated = await client.updateTestCase(input.testUuid, { name: input.name, description: input.description, agentTaskDescription: input.agentTaskDescription, }); logger.toolComplete('update_test_case', Date.now() - start); return { content: [{ type: 'text', text: JSON.stringify(updated, null, 2) }] }; } catch (error) { logger.toolError('update_test_case', error as Error, Date.now() - start); throw handleExternalServiceError(error, 'DebuggAI', 'update_test_case'); } } - types/index.ts:395-402 (schema)Zod schema (UpdateTestCaseInputSchema) and TypeScript type (UpdateTestCaseInput) for the tool's input validation.
export const UpdateTestCaseInputSchema = z.object({ testUuid: z.string().uuid(), name: z.string().min(1).optional(), description: z.string().min(1).optional(), agentTaskDescription: z.string().min(1).optional(), }).strict(); export type UpdateTestCaseInput = z.infer<typeof UpdateTestCaseInputSchema>; - tools/index.ts:52-55 (registration)Tool registration: buildUpdateTestCaseTool() is called and added to the tools array at line 52 (and validated variant at line 74) during initTools().
buildUpdateTestCaseTool(), buildDeleteTestCaseTool(), buildRunTestSuiteTool(), buildGetTestSuiteResultsTool(), - tools/testSuiteTools.ts:132-149 (registration)Tool definition builder: buildUpdateTestCaseTool() defines the tool name ('update_test_case'), title, description, and inputSchema. buildValidatedUpdateTestCaseTool() pairs it with the Zod schema and handler at line 151-153.
export function buildUpdateTestCaseTool(): Tool { return { name: 'update_test_case', title: 'Update Test Case', description: 'Update a test case\'s name, description, or agentTaskDescription. Requires testUuid. At least one of name, description, or agentTaskDescription must be provided. Returns the updated test case.', inputSchema: { type: 'object', properties: { testUuid: { type: 'string', description: 'UUID of the test case to update. Required.' }, name: { type: 'string', description: 'New name for the test case.', minLength: 1 }, description: { type: 'string', description: 'New description.', minLength: 1 }, agentTaskDescription: { type: 'string', description: 'New agent task description.', minLength: 1 }, }, required: ['testUuid'], additionalProperties: false, }, }; } - services/index.ts:607-623 (helper)The service-layer helper: DebuggAIServerClient.updateTestCase() makes a PATCH request to api/v1/e2e-tests/{testUuid}/ to update the test case on the backend.
public async updateTestCase( testUuid: string, patch: { name?: string; description?: string; agentTaskDescription?: string }, ): Promise<{ uuid: string; name: string; description: string; agentTaskDescription: string }> { if (!this.tx) throw new Error('Client not initialized — call init() first'); const body: Record<string, any> = {}; if (patch.name !== undefined) body.name = patch.name; if (patch.description !== undefined) body.description = patch.description; if (patch.agentTaskDescription !== undefined) body.agent_task_description = patch.agentTaskDescription; const t = await this.tx.patch<any>(`api/v1/e2e-tests/${testUuid}/`, body); return { uuid: t.uuid, name: t.name, description: t.description, agentTaskDescription: t.agentTaskDescription ?? t.agent_task_description ?? '', }; }