Skip to main content
Glama

delete_subtask

Remove an uncompleted subtask from a task to update progress and manage workflow effectively.

Instructions

Delete a subtask from a task. Provide 'requestId', 'taskId', and 'subtaskId'.

Only uncompleted subtasks can be deleted.

A progress table will be displayed showing the updated task with its remaining subtasks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYes
taskIdYes
subtaskIdYes

Implementation Reference

  • MCP tool handler function that parses arguments and delegates to the TaskFlowService.deleteSubtask method.
    async delete_subtask(args: any) {
      const { requestId, taskId, subtaskId } = args ?? {};
      return service.deleteSubtask(String(requestId), String(taskId), String(subtaskId));
    },
  • Core implementation of subtask deletion in TaskFlowService: loads tasks, validates existence and incompletion, removes subtask, saves, and returns progress table.
    public async deleteSubtask(requestId: string, taskId: string, subtaskId: string) {
      await this.loadTasks();
      const req = this.getRequest(requestId);
      if (!req) return { status: "error", message: "Request not found" };
    
      const task = req.tasks.find((t) => t.id === taskId);
      if (!task) return { status: "error", message: "Task not found" };
    
      const subtaskIndex = task.subtasks.findIndex((s) => s.id === subtaskId);
      if (subtaskIndex === -1) return { status: "error", message: "Subtask not found" };
      if (task.subtasks[subtaskIndex].done) return { status: "error", message: "Cannot delete completed subtask" };
    
      task.subtasks.splice(subtaskIndex, 1);
      await this.saveTasks();
    
      const progressTable = formatTaskProgressTableForRequest(req);
      return { status: "subtask_deleted", message: `Subtask ${subtaskId} has been deleted.\n${progressTable}` };
    }
  • Input schema definition for the delete_subtask tool parameters.
    delete_subtask: {
      type: "object",
      properties: {
        requestId: { type: "string" },
        taskId: { type: "string" },
        subtaskId: { type: "string" },
      },
      required: ["requestId", "taskId", "subtaskId"],
    },
  • Tool registration: exports the DELETE_SUBTASK_TOOL object with name, description, and inputSchema used by the MCP server.
    export const DELETE_SUBTASK_TOOL: Tool = {
      name: "delete_subtask",
      description:
        "Delete a subtask from a task. Provide 'requestId', 'taskId', and 'subtaskId'.\n\n" +
        "Only uncompleted subtasks can be deleted.\n\n" +
        "A progress table will be displayed showing the updated task with its remaining subtasks.",
      inputSchema: {
        type: "object",
        properties: {
          requestId: { type: "string" },
          taskId: { type: "string" },
          subtaskId: { type: "string" },
        },
        required: ["requestId", "taskId", "subtaskId"],
      },
    };
  • Tool registration in the MCP server's listTools response, including DELETE_SUBTASK_TOOL in the available tools array.
    DELETE_SUBTASK_TOOL,
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the destructive nature ('delete'), the constraint on uncompleted subtasks, and the output behavior ('A progress table will be displayed showing the updated task with its remaining subtasks'). This covers key aspects like mutability, preconditions, and visual feedback, though it lacks details on error handling or permissions.

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 front-loaded with the core purpose, followed by essential constraints and output details in three concise sentences. Each sentence adds critical information without redundancy, making it efficient and well-structured for quick comprehension by an agent.

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

Completeness3/5

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

For a destructive tool with no annotations and no output schema, the description does a decent job by covering the action, constraints, and visual output. However, it misses details like error cases (e.g., invalid IDs), side effects, or confirmation requirements, which are important for safe invocation. Given the complexity of deletion operations, this leaves room for improvement.

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?

The schema description coverage is 0%, so the description must compensate. It lists the three required parameters ('requestId', 'taskId', and 'subtaskId') but doesn't explain their meaning, format, or relationships (e.g., that subtaskId must belong to taskId). This adds minimal semantic value beyond naming the parameters, failing to fully address the coverage gap.

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

Purpose5/5

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

The description clearly states the specific action ('Delete a subtask from a task'), identifies the resource ('subtask'), and distinguishes it from siblings like 'delete_task' (which deletes entire tasks) and 'mark_subtask_done' (which completes rather than removes subtasks). The verb 'delete' is precise and unambiguous.

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

Usage Guidelines4/5

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

The description provides explicit guidance on when NOT to use this tool ('Only uncompleted subtasks can be deleted'), which helps the agent avoid errors. However, it doesn't mention alternatives like 'mark_subtask_done' for completed subtasks or clarify prerequisites beyond the required parameters, leaving some contextual gaps.

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