Skip to main content
Glama

taskStepDelete

Remove specific steps from tasks in GonMCPtool by specifying taskId and stepId, streamlining task management for efficient project workflows.

Instructions

刪除任務的特定步驟

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepIdYes
taskIdYes

Implementation Reference

  • Core handler implementation that deletes the specified step from the task, reorders remaining steps, updates timestamp, and saves to tasks.json
    public static async deleteTaskStep(taskId: string, stepId: string): Promise<Task | null> { const tasks = await this.readTasks(); const taskIndex = tasks.findIndex(t => t.id === taskId); if (taskIndex === -1) { return null; } const task = tasks[taskIndex]; const initialStepsLength = task.steps.length; // 刪除步驟 task.steps = task.steps.filter(s => s.id !== stepId); if (task.steps.length === initialStepsLength) { return null; } // 重新排序步驟 task.steps = task.steps.map((step, index) => ({ ...step, order: index + 1 })); // 更新任務 task.updatedAt = new Date().toISOString(); // 保存所有任務 await this.writeTasks(tasks); return task; }
  • main.ts:776-801 (registration)
    Registers the taskStepDelete tool with Zod input schema (taskId, stepId) and thin wrapper handler that calls TaskManagerTool.deleteTaskStep
    server.tool("taskStepDelete", "刪除任務的特定步驟", { taskId: z.string(), stepId: z.string() }, async ({ taskId, stepId }) => { try { const updatedTask = await TaskManagerTool.deleteTaskStep(taskId, stepId); if (!updatedTask) { return { content: [{ type: "text", text: `未找到指定的任務或步驟` }] }; } return { content: [{ type: "text", text: `步驟刪除成功:\n${JSON.stringify(updatedTask, null, 2)}` }] }; } catch (error) { return { content: [{ type: "text", text: `刪除步驟失敗: ${error instanceof Error ? error.message : "未知錯誤"}` }] }; } } );
  • Zod input schema defining parameters for taskStepDelete tool: taskId (string), stepId (string)
    taskId: z.string(), stepId: z.string() },

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/GonTwVn/GonMCPtool'

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