delete_test_plan
Permanently delete a test plan and its execution data from TestCollab using the test plan ID. This action removes all related testing resources.
Instructions
Delete a test plan from TestCollab.
WARNING: This permanently deletes the test plan and related execution data.
Required: id (test plan ID) Optional: project_id
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Test plan ID to delete (required) | |
| project_id | No | Project ID (optional if TC_DEFAULT_PROJECT is set) |
Implementation Reference
- src/tools/test-plans/delete.ts:41-95 (handler)The handler function for deleting a test plan, which resolves the project ID, calls the API client, and formats the response.
export async function handleDeleteTestPlan(args: { id: number; project_id?: number; }): Promise<{ content: Array<{ type: "text"; text: string }> }> { try { const projectId = resolveProjectId(args.project_id); if (!projectId) { return { content: [ { type: "text" as const, text: JSON.stringify({ error: { code: "MISSING_PROJECT_ID", message: "No project_id provided and no default project configured. Set TC_DEFAULT_PROJECT or pass project_id.", }, }), }, ], }; } const client = getApiClient(); const result = await client.deleteTestPlan(args.id, projectId); return { content: [ { type: "text" as const, text: JSON.stringify({ success: true, deleted_test_plan_id: args.id, result, }), }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: JSON.stringify({ error: { code: "DELETE_TEST_PLAN_FAILED", message: error instanceof Error ? error.message : "Unknown error", }, }), }, ], }; } } - src/tools/test-plans/delete.ts:15-21 (schema)Zod schema for validating the input arguments for the delete_test_plan tool.
export const deleteTestPlanSchema = z.object({ id: z.number().describe("Test plan ID to delete (required)"), project_id: z .number() .optional() .describe("Project ID (optional if TC_DEFAULT_PROJECT is set)"), }); - src/tools/test-plans/delete.ts:27-35 (registration)Tool definition containing name and description for the delete_test_plan tool.
export const deleteTestPlanTool = { name: "delete_test_plan", description: `Delete a test plan from TestCollab. WARNING: This permanently deletes the test plan and related execution data. Required: id (test plan ID) Optional: project_id`, };