Skip to main content
Glama

delete_task

Remove an uncompleted task from a request in MCP TaskManager. Displays remaining tasks post-deletion for progress tracking. Requires requestId and taskId as inputs.

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 main handler function that implements the delete_task tool logic: finds the request and task, checks if deletable, removes the task from the array, saves, and returns a success message with progress table.
    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), }; }
  • Zod schema defining the input parameters for the delete_task tool: 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 input schema.
    { name: "delete_task", description: "Delete a task from a request.", inputSchema: DeleteTaskSchema, },
  • Dispatch handler in callTool method that parses input using the schema and invokes the deleteTask method.
    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); }

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

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