Skip to main content
Glama

delete_task

Remove a specific task from a project by providing the project ID and task ID in the taskqueue-mcp server.

Instructions

Remove a task from a project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe ID of the project containing the task (e.g., proj-1).
taskIdYesThe ID of the task to delete (e.g., task-1).

Implementation Reference

  • The ToolExecutor implementation for 'delete_task', which validates input parameters projectId and taskId, then delegates execution to TaskManager.deleteTask.
    const deleteTaskToolExecutor: ToolExecutor = { name: "delete_task", async execute(taskManager, args) { // 1. Argument Validation const projectId = validateProjectId(args.projectId); const taskId = validateTaskId(args.taskId); // 2. Core Logic Execution const resultData = await taskManager.deleteTask(projectId, taskId); // 3. Return raw success data return resultData; }, }; toolExecutorMap.set(deleteTaskToolExecutor.name, deleteTaskToolExecutor);
  • The Tool object definition for 'delete_task' including name, description, and input schema requiring projectId and taskId.
    /** * Delete Task Tool * @param {object} args - A JSON object containing the arguments * @see {deleteTaskToolExecutor} */ const deleteTaskTool: Tool = { name: "delete_task", description: "Remove a task from a project.", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "The ID of the project containing the task (e.g., proj-1).", }, taskId: { type: "string", description: "The ID of the task to delete (e.g., task-1).", }, }, required: ["projectId", "taskId"], }, };
  • The core TaskManager.deleteTask method that locates the task in the project, checks preconditions (not completed project, not approved task), removes it from the array, and persists to disk.
    public async deleteTask(projectId: string, taskId: string): Promise<DeleteTaskSuccessData> { await this.ensureInitialized(); await this.reloadFromDisk(); const proj = this.data.projects.find((p) => p.projectId === projectId); if (!proj) { throw new AppError(`Project ${projectId} not found`, AppErrorCode.ProjectNotFound); } if (proj.completed) { throw new AppError('Project is already completed', AppErrorCode.ProjectAlreadyCompleted); } const taskIndex = proj.tasks.findIndex((t) => t.id === taskId); if (taskIndex === -1) { throw new AppError(`Task ${taskId} not found`, AppErrorCode.TaskNotFound); } const task = proj.tasks[taskIndex]; if (task.approved) { throw new AppError('Cannot delete an approved task', AppErrorCode.CannotModifyApprovedTask); } proj.tasks.splice(taskIndex, 1); await this.saveTasks(); return { message: `Task ${taskId} deleted from project ${projectId}`, }; }
  • Registration of the deleteTaskTool in the exported ALL_TOOLS array used for MCP tool listing.
    export const ALL_TOOLS: Tool[] = [ listProjectsTool, readProjectTool, createProjectTool, deleteProjectTool, addTasksToProjectTool, finalizeProjectTool, generateProjectPlanTool, listTasksTool, readTaskTool, createTaskTool, updateTaskTool, deleteTaskTool, approveTaskTool, getNextTaskTool, ];
  • Registration of the deleteTaskToolExecutor in the toolExecutorMap used by executeToolAndHandleErrors.
    toolExecutorMap.set(deleteTaskToolExecutor.name, deleteTaskToolExecutor);

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/chriscarrollsmith/taskqueue-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server