Skip to main content
Glama

delete_task

Remove uncompleted tasks from the MCP TaskManager queue to maintain an organized workflow and track remaining tasks.

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

  • Zod input schema for the delete_task tool, requiring requestId and taskId.
    const DeleteTaskSchema = z.object({
      requestId: z.string(),
      taskId: z.string(),
    });
  • index.ts:190-194 (registration)
    Registration of the delete_task tool in the listTools method, including name, description, and schema reference.
    {
      name: "delete_task",
      description: "Delete a task from a request.",
      inputSchema: DeleteTaskSchema,
    },
  • Dispatcher case in callTool method that parses input using the schema and delegates to the deleteTask handler.
    case "delete_task": {
      const parsed = DeleteTaskSchema.safeParse(parameters);
      if (!parsed.success) {
        throw new Error(`Invalid parameters: ${parsed.error}`);
      }
      return this.deleteTask(parsed.data.requestId, parsed.data.taskId);
    }
  • Core handler implementation: finds the request and task, validates task is not done/approved, removes the task, saves data, returns success message with updated progress.
    public async deleteTask(requestId: string, taskId: string) {
      const request = this.data.requests.find((r) => r.requestId === requestId);
      if (!request) {
        throw new Error("Request not found");
      }
    
      const taskIndex = request.tasks.findIndex((t) => t.id === taskId);
      if (taskIndex === -1) {
        throw new Error("Task not found");
      }
    
      const task = request.tasks[taskIndex];
      if (task.done || task.approved) {
        throw new Error("Cannot delete completed or approved tasks");
      }
    
      request.tasks.splice(taskIndex, 1);
    
      await this.saveTasks();
    
      return {
        message:
          "Task deleted successfully.\n" + this.formatTaskProgressTable(requestId),
      };
    }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses that deletion is limited to uncompleted tasks and mentions a 'progress table will be displayed' as output behavior. However, it lacks details on permissions, error handling, or irreversible effects, which are important for a destructive operation like deletion.

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

Conciseness4/5

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

The description is concise with two sentences that are front-loaded: the first states the action and constraint, and the second describes the output. There's no wasted text, but it could be slightly more structured (e.g., bullet points for clarity).

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?

Given a destructive tool with no annotations, 0% schema coverage, and no output schema, the description is incomplete. It covers the basic action and constraint but misses parameter details, error cases, and full behavioral context. It's minimally viable but has clear gaps for such a critical operation.

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

Parameters2/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 description adds no parameter semantics beyond what the bare schema provides, failing to address the coverage gap.

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 evident. However, it doesn't explicitly distinguish this tool from sibling tools like 'mark_task_done' or 'update_task', which could also modify task states, so it misses full sibling differentiation.

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 context by stating 'Only uncompleted tasks can be deleted,' which implies when to use this tool (for uncompleted tasks) and hints at an alternative (e.g., completed tasks might require a different approach). However, it doesn't explicitly name alternatives or specify when not to use it relative to siblings like 'mark_task_done'.

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/Rudra-ravi/mcp-taskmanager'

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