Skip to main content
Glama

taskStepDelete

Remove specific steps from tasks to maintain organized workflows and eliminate unnecessary actions.

Instructions

刪除任務的特定步驟

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYes
stepIdYes

Implementation Reference

  • main.ts:776-801 (registration)
    Registration of the 'taskStepDelete' MCP tool, including description, Zod input schema, and thin async handler that delegates to TaskManagerTool.deleteTaskStep and handles response formatting.
    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 : "未知錯誤"}` }]
                };
            }
        }
    );
  • Core handler logic for deleting a task step: loads tasks, finds task, filters out the step by ID, reorders remaining steps, updates timestamp, and persists changes to storage.
    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;
    }
  • Zod schema defining input parameters: taskId (string) and stepId (string).
    {
        taskId: z.string(),
        stepId: z.string()
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. While '刪除' (delete) implies a destructive mutation, it doesn't disclose behavioral traits like whether deletion is permanent/reversible, permission requirements, error conditions (e.g., invalid IDs), or what happens to task structure after step removal. This is inadequate for a mutation tool with zero annotation coverage.

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 a single, efficient sentence in Chinese with zero wasted words. It's appropriately sized for a simple deletion operation and front-loaded with the core action.

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

Completeness2/5

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

For a destructive mutation tool with no annotations, 0% schema description coverage, and no output schema, the description is incomplete. It lacks essential context like behavioral details, parameter meanings, error handling, and output expectations, leaving significant gaps for agent understanding.

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?

Schema description coverage is 0%, so the description must compensate. It implies parameters for identifying a task and step ('任務的特定步驟'), but doesn't specify what 'taskId' and 'stepId' represent (e.g., format, source). The description adds minimal value beyond the schema's parameter names, 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.

Purpose4/5

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

The description '刪除任務的特定步驟' (Delete a specific step of a task) clearly states the verb ('刪除' - delete) and resource ('任務的特定步驟' - specific step of a task). It distinguishes from sibling tools like 'taskDelete' (deletes entire tasks) and 'taskStepAdd' (adds steps), but doesn't explicitly mention this differentiation in the description itself.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing task/step), exclusions, or comparisons to similar tools like 'taskDelete' or 'taskStepUpdate'.

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

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