Skip to main content
Glama

delete_task

Remove a specific task from the MCP Orchestrator Server if it has no dependent tasks, ensuring clean task management and dependency integrity.

Instructions

Delete a task if it has no dependents

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesID of the task to delete

Implementation Reference

  • Handler for the 'delete_task' tool: deletes a task by ID after verifying it exists and has no dependent tasks, then saves the task list and returns confirmation.
    case "delete_task": { const { task_id } = request.params.arguments as { task_id: string; }; debug(`Deleting task ${task_id}`); const task = tasks[task_id]; if (!task) { throw new McpError(ErrorCode.InvalidRequest, `Task ${task_id} not found`); } // Check if any other tasks depend on this one const dependentTasks = Object.values(tasks).filter(t => t.dependencies?.includes(task_id) ); if (dependentTasks.length > 0) { throw new McpError( ErrorCode.InvalidRequest, `Cannot delete task ${task_id} as it has dependent tasks: ${dependentTasks.map(t => t.id).join(', ')}` ); } delete tasks[task_id]; saveTasks(); debug(`Deleted task ${task_id}`); return { content: [{ type: "text", text: JSON.stringify({ deleted: task_id }, null, 2) }] }; }
  • src/index.ts:388-401 (registration)
    Registration of the 'delete_task' tool in the ListTools response, including its name, description, and input schema.
    { name: "delete_task", description: "Delete a task if it has no dependents", inputSchema: { type: "object", properties: { task_id: { type: "string", description: "ID of the task to delete" } }, required: ["task_id"] } },
  • Input schema definition for the 'delete_task' tool, specifying the required 'task_id' parameter.
    inputSchema: { type: "object", properties: { task_id: { type: "string", description: "ID of the task to delete" } }, required: ["task_id"] }

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/mokafari/orchestrator-server'

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