Skip to main content
Glama

delete_task

Remove uncompleted tasks from TaskFlow MCP requests to manage workflows. Displays remaining tasks in a progress table after deletion.

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

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYes
taskIdYes

Implementation Reference

  • The MCP tool handler function for 'delete_task' that extracts requestId and taskId from arguments and delegates to TaskFlowService.deleteTask.
    async delete_task(args: any) {
      const { requestId, taskId } = args ?? {};
      return service.deleteTask(String(requestId), String(taskId));
    },
  • Core implementation in TaskFlowService: loads task data, verifies request and task exist and task not done, removes task from array, saves file, generates 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}` };
    }
  • JSON Schema definition for delete_task input parameters: requires requestId and taskId.
    delete_task: {
      type: "object",
      properties: {
        requestId: { type: "string" },
        taskId: { type: "string" },
      },
      required: ["requestId", "taskId"],
    },
  • Tool metadata registration: defines name, description, and inputSchema for the delete_task tool.
    export const DELETE_TASK_TOOL: Tool = {
      name: "delete_task",
      description:
        "Delete a specific task from a request. Only uncompleted tasks can be deleted.\n\n" +
        "A progress table will be displayed showing the remaining tasks after deletion.",
      inputSchema: {
        type: "object",
        properties: {
          requestId: { type: "string" },
          taskId: { type: "string" },
        },
        required: ["requestId", "taskId"],
      },
    };
  • Server registration: DELETE_TASK_TOOL included in the tools list returned by ListToolsRequest handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        PLAN_TASK_TOOL,
        GET_NEXT_TASK_TOOL,
        MARK_TASK_DONE_TOOL,
        OPEN_TASK_DETAILS_TOOL,
        LIST_REQUESTS_TOOL,
        ADD_TASKS_TO_REQUEST_TOOL,
        UPDATE_TASK_TOOL,
        DELETE_TASK_TOOL,
        ADD_SUBTASKS_TOOL,
        MARK_SUBTASK_DONE_TOOL,
        UPDATE_SUBTASK_TOOL,
        DELETE_SUBTASK_TOOL,
        EXPORT_TASK_STATUS_TOOL,
        ADD_NOTE_TOOL,
        UPDATE_NOTE_TOOL,
        DELETE_NOTE_TOOL,
        ADD_DEPENDENCY_TOOL,
        GET_PROMPTS_TOOL,
        SET_PROMPTS_TOOL,
        UPDATE_PROMPTS_TOOL,
        REMOVE_PROMPTS_TOOL,
        ARCHIVE_COMPLETED_REQUESTS_TOOL,
        LIST_ARCHIVED_REQUESTS_TOOL,
        RESTORE_ARCHIVED_REQUEST_TOOL,
      ],
    }));
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the deletion constraint and that a progress table will be displayed, but it doesn't disclose critical behavioral traits like whether this action is reversible, what permissions are required, or potential side effects on dependencies. For a destructive operation with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two concise sentences. The first sentence states the core action and constraint, while the second describes the output behavior. There's no wasted text, and it's front-loaded with essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given this is a destructive tool with no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It lacks details on error conditions, return values beyond the progress table mention, and how this tool fits into the broader workflow with siblings like 'delete_subtask'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It doesn't explain what 'requestId' or 'taskId' represent, their formats, or how to obtain them. The baseline is 3 because the schema provides the structure, but the description adds no meaningful parameter semantics beyond what's implied by the tool name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and resource ('a specific task from a request'), making the purpose understandable. However, it doesn't explicitly differentiate this tool from sibling tools like 'delete_subtask' or 'delete_note', which reduces it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage guidance by stating 'Only uncompleted tasks can be deleted,' which implies when NOT to use it. However, it doesn't explicitly mention when to use this tool versus alternatives like 'archive_completed_requests' or 'update_task' for modifying tasks instead of deleting them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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