delete_task
Move a specific task to the trash by its unique 12-character ID, allowing recovery if needed, without altering any other task details.
Instructions
Move an existing task to the trash, where it can be recovered if needed. Nothing else about the task will be changed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The 12-character alphanumeric ID of the task |
Implementation Reference
- index.ts:428-434 (handler)The handler logic for the 'delete_task' tool within the CallToolRequestSchema switch statement. It validates the input 'id' using getIdValidated, calls TaskService.deleteTask(id), and returns the result as a JSON string.case DELETE_TASK_TOOL.name: { const id = getIdValidated(args.id); const task = await TaskService.deleteTask(id); return { content: [{ type: "text", text: JSON.stringify(task, null, 2) }], }; }
- tools.ts:352-367 (schema)The Tool object definition for 'delete_task', including name, description, and inputSchema requiring a task 'id' with 12-character alphanumeric pattern.export const DELETE_TASK_TOOL: Tool = { name: "delete_task", description: "Move an existing task to the trash, where it can be recovered if needed. Nothing else about the task will be changed.", inputSchema: { type: "object", properties: { id: { type: "string", description: "The 12-character alphanumeric ID of the task", pattern: "^[a-zA-Z0-9]{12}$", }, }, required: ["id"], }, };
- index.ts:192-214 (registration)The 'TOOLS' array registers the DELETE_TASK_TOOL along with other tools, which is returned by the ListToolsRequestSchema handler.const TOOLS = [ // Config GET_CONFIG_TOOL, // Tasks CREATE_TASK_TOOL, LIST_TASKS_TOOL, GET_TASK_TOOL, UPDATE_TASK_TOOL, DELETE_TASK_TOOL, // Docs CREATE_DOC_TOOL, LIST_DOCS_TOOL, GET_DOC_TOOL, UPDATE_DOC_TOOL, DELETE_DOC_TOOL, // Comments ADD_TASK_COMMENT_TOOL, LIST_TASK_COMMENTS_TOOL, // Other GET_DARTBOARD_TOOL, GET_FOLDER_TOOL, GET_VIEW_TOOL, ];
- index.ts:67-76 (helper)Helper function 'getIdValidated' used in the delete_task handler to validate the task ID matches the 12-character alphanumeric pattern.const getIdValidated = (strMaybe: any, name: string = "ID"): string => { if (typeof strMaybe !== "string" && !(strMaybe instanceof String)) { throw new Error(`${name} must be a string`); } const id = strMaybe.toString(); if (!ID_REGEX.test(id)) { throw new Error(`${name} must be 12 alphanumeric characters`); } return id; };
- index.ts:36-52 (registration)Import of DELETE_TASK_TOOL from './tools.js' enabling its use in the server.ADD_TASK_COMMENT_TOOL, CREATE_DOC_TOOL, CREATE_TASK_TOOL, DELETE_DOC_TOOL, DELETE_TASK_TOOL, GET_CONFIG_TOOL, GET_DARTBOARD_TOOL, GET_DOC_TOOL, GET_FOLDER_TOOL, GET_TASK_TOOL, GET_VIEW_TOOL, LIST_DOCS_TOOL, LIST_TASK_COMMENTS_TOOL, LIST_TASKS_TOOL, UPDATE_DOC_TOOL, UPDATE_TASK_TOOL, } from "./tools.js";