delete_issue
Permanently remove issues from the task hierarchy. Exercise caution as deletion affects related issues and cannot be undone.
Instructions
Deletes an issue from the task trellis system
Use this tool to permanently remove issues from the task hierarchy. Exercise caution as deletion affects related issues and cannot be easily undone.
Safety considerations:
Standard deletion validates relationships and prevents deletion of issues with dependencies
Issues with children or that serve as prerequisites for other issues may be protected
Use 'force=true' to bypass safety checks for administrative cleanup
Consider updating status to 'cancelled' instead of deletion for audit trail preservation
Deletion impacts:
Removes issue and all associated metadata permanently
Updates parent-child relationships by removing deleted issue from parent's children list
Other issues referencing this as a prerequisite may become invalid
Historical references in logs and activity trails are preserved but point to non-existent issue
Best practices:
Verify issue has no active dependencies before deletion
Use list/get tools to understand relationships before deletion
Prefer status updates to 'cancelled' over deletion for important work items
Use force deletion only for cleanup of test data or administrative maintenance
This operation is irreversible - ensure you have the correct issue ID before proceeding.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the issue to delete | |
| force | No | Force delete flag (defaults to false) |
Implementation Reference
- src/tools/deleteObjectTool.ts:45-75 (handler)The handler function that implements the core logic of the 'delete_issue' tool. It extracts the issue ID and force flag from arguments, calls the repository's deleteObject method, and returns a success or error message in the expected MCP format.export async function handleDeleteObject( repository: Repository, args: unknown, ) { const { id, force = false } = args as { id: string; force?: boolean; }; try { await repository.deleteObject(id, force); return { content: [ { type: "text", text: `Successfully deleted object: ${id}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error deleting object with ID "${id}": ${error instanceof Error ? error.message : String(error)}`, }, ], }; } }
- src/tools/deleteObjectTool.ts:3-43 (schema)Tool specification for 'delete_issue', including name, detailed description, and input schema defining required 'id' string and optional 'force' boolean.export const deleteObjectTool = { name: "delete_issue", description: `Deletes an issue from the task trellis system Use this tool to permanently remove issues from the task hierarchy. Exercise caution as deletion affects related issues and cannot be easily undone. Safety considerations: - Standard deletion validates relationships and prevents deletion of issues with dependencies - Issues with children or that serve as prerequisites for other issues may be protected - Use 'force=true' to bypass safety checks for administrative cleanup - Consider updating status to 'cancelled' instead of deletion for audit trail preservation Deletion impacts: - Removes issue and all associated metadata permanently - Updates parent-child relationships by removing deleted issue from parent's children list - Other issues referencing this as a prerequisite may become invalid - Historical references in logs and activity trails are preserved but point to non-existent issue Best practices: - Verify issue has no active dependencies before deletion - Use list/get tools to understand relationships before deletion - Prefer status updates to 'cancelled' over deletion for important work items - Use force deletion only for cleanup of test data or administrative maintenance This operation is irreversible - ensure you have the correct issue ID before proceeding.`, inputSchema: { type: "object", properties: { id: { type: "string", description: "ID of the issue to delete", }, force: { type: "boolean", description: "Force delete flag (defaults to false)", default: false, }, }, required: ["id"], }, } as const;
- src/server.ts:176-197 (registration)Registers the 'delete_issue' tool (as deleteObjectTool) in the list returned by ListToolsRequestSchema, making it discoverable by MCP clients.server.setRequestHandler(ListToolsRequestSchema, () => { const tools: unknown[] = [ createObjectTool, updateObjectTool, getObjectTool, deleteObjectTool, listObjectsTool, appendObjectLogTool, appendModifiedFilesTool, claimTaskTool, getNextAvailableIssueTool, completeTaskTool, ]; // Only include activate tool if server is not properly configured from command line // (i.e., local mode without projectRootFolder specified) if (serverConfig.mode === "local" && !serverConfig.planningRootFolder) { tools.push(activateTool); } return { tools }; });
- src/server.ts:255-279 (registration)Dispatches calls to the 'delete_issue' tool handler (handleDeleteObject) within the CallToolRequestSchema switch statement.switch (toolName) { case "create_issue": return handleCreateObject(_getService(), repository, args); case "update_issue": return handleUpdateObject(_getService(), repository, args, serverConfig); case "get_issue": return handleGetObject(repository, args); case "delete_issue": return handleDeleteObject(repository, args); case "list_issues": return handleListObjects(_getService(), repository, args); case "append_issue_log": return handleAppendObjectLog(_getService(), repository, args); case "append_modified_files": return handleAppendModifiedFiles(_getService(), repository, args); case "claim_task": return handleClaimTask(_getService(), repository, args); case "get_next_available_issue": return handleGetNextAvailableIssue(_getService(), repository, args); case "complete_task": return handleCompleteTask(_getService(), repository, args, serverConfig); case "activate": default: throw new Error(`Unknown tool: ${toolName}`); }