Skip to main content
Glama

delete_task

Remove uncompleted tasks from a request to streamline task management. View a progress table to track remaining tasks after deletion, ensuring efficient workflow organization.

Instructions

Delete a specific task from a request. Only uncompleted tasks can be deleted.

A progress table will be displayed showing the remaining tasks after deletion.

Input Schema

NameRequiredDescriptionDefault
requestIdYes
taskIdYes

Input Schema (JSON Schema)

{ "properties": { "requestId": { "type": "string" }, "taskId": { "type": "string" } }, "required": [ "requestId", "taskId" ], "type": "object" }

Implementation Reference

  • MCP tool handler function that extracts requestId and taskId from args and delegates to TaskFlowService.deleteTask method.
    async delete_task(args: any) { const { requestId, taskId } = args ?? {}; return service.deleteTask(String(requestId), String(taskId)); },
  • JSON Schema defining the input parameters for the delete_task tool: requestId and taskId as required strings.
    delete_task: { type: "object", properties: { requestId: { type: "string" }, taskId: { type: "string" }, }, required: ["requestId", "taskId"], },
  • DELETE_TASK_TOOL constant is included in the array of tools provided by the listTools request handler.
    DELETE_TASK_TOOL,
  • Core service method implementing the deletion logic: loads data, finds and validates the task, removes it from the request's tasks array, saves changes, and returns updated progress table.
    public async deleteTask(requestId: string, taskId: string) { await this.loadTasks(); const req = this.getRequest(requestId); if (!req) return { status: "error", message: "Request not found" }; const taskIndex = req.tasks.findIndex((t) => t.id === taskId); if (taskIndex === -1) return { status: "error", message: "Task not found" }; if (req.tasks[taskIndex].done) return { status: "error", message: "Cannot delete completed task" }; req.tasks.splice(taskIndex, 1); await this.saveTasks(); const progressTable = formatTaskProgressTableForRequest(req); return { status: "task_deleted", message: `Task ${taskId} has been deleted.\n${progressTable}` }; }

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/pinkpixel-dev/taskflow-mcp'

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