Skip to main content
Glama

taskStepUpdate

Update specific steps within tasks by modifying descriptions, completion status, order, or estimated time using task and step identifiers.

Instructions

更新任務的特定步驟

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYes
stepIdYes
updatesYes

Implementation Reference

  • main.ts:712-743 (registration)
    Registers the 'taskStepUpdate' MCP tool with server.tool(), including description, Zod input schema, thin handler wrapper, and response formatting.
    server.tool("taskStepUpdate",
        "更新任務的特定步驟",
        {
            taskId: z.string(),
            stepId: z.string(),
            updates: z.object({
                description: z.string().optional(),
                completed: z.boolean().optional(),
                order: z.number().optional(),
                estimatedTime: z.number().optional()
            })
        },
        async ({ taskId, stepId, updates }) => {
            try {
                const updatedTask = await TaskManagerTool.updateTaskStep(taskId, stepId, updates);
    
                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 updating a specific task step: loads tasks from storage, locates task and step, merges updates, updates timestamp, checks if all steps complete (logs prompt), persists changes, returns updated task.
    public static async updateTaskStep(taskId: string, stepId: string, updates: Partial<Omit<TaskStep, 'id'>>): 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 stepIndex = task.steps.findIndex(s => s.id === stepId);
    
      if (stepIndex === -1) {
        return null;
      }
    
      // 更新步驟
      task.steps[stepIndex] = {
        ...task.steps[stepIndex],
        ...updates
      };
    
      // 更新任務
      task.updatedAt = new Date().toISOString();
    
      // 檢查所有步驟是否完成,如果所有步驟完成則提示用戶使用 completeTask
      const allStepsCompleted = task.steps.every(s => s.completed);
      if (allStepsCompleted && task.status !== TaskStatus.COMPLETED) {
        // 不自動設置任務為完成狀態,顯示提示信息
        console.log(`任務 "${task.title}" 的所有步驟已完成,請使用 completeTask 方法將任務標記為已完成`);
      }
    
      // 保存所有任務
      await this.writeTasks(tasks);
    
      return task;
    }
  • Zod input schema for the taskStepUpdate tool, defining required taskId/stepId and optional updates matching TaskStep properties.
    taskId: z.string(),
    stepId: z.string(),
    updates: z.object({
        description: z.string().optional(),
        completed: z.boolean().optional(),
        order: z.number().optional(),
        estimatedTime: z.number().optional()
    })
  • TypeScript interface defining TaskStep structure, used as basis for schema updates (excludes id which is immutable).
    export interface TaskStep {
      /**
       * 步驟ID
       */
      id: string;
      
      /**
       * 步驟描述
       */
      description: string;
      
      /**
       * 步驟是否完成
       */
      completed?: boolean;
      
      /**
       * 步驟順序
       */
      order?: number;
      
      /**
       * 步驟預估完成時間(分鐘)
       */
      estimatedTime?: number;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Update' implies a mutation operation, but the description doesn't specify permissions required, whether changes are reversible, rate limits, or what the response looks like (e.g., success/failure indicators). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 extremely concise—a single phrase in Chinese—and front-loaded with the core action. There's no wasted text, making it efficient to parse, though this brevity contributes to gaps in other dimensions.

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?

Given the tool's complexity (a mutation operation with 3 parameters, nested objects, and no annotations or output schema), the description is incomplete. It doesn't explain behavioral aspects, parameter meanings, or usage context, which are critical for an agent to invoke it correctly. The conciseness comes at the cost of necessary detail for this type of tool.

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?

The description adds no parameter semantics beyond what the input schema provides. With 0% schema description coverage and 3 parameters (including a nested 'updates' object with 4 properties), the schema alone documents structure but not meaning (e.g., what 'taskId' and 'stepId' refer to, or the purpose of fields like 'estimatedTime'). The description doesn't compensate for this lack, leaving parameters largely unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

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

The description '更新任務的特定步驟' (Update specific step of a task) clearly states the verb ('update') and resource ('specific step of a task'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'taskUpdate' or 'taskStepAdd', which also modify task-related data, leaving some ambiguity about its specific role.

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 and step), exclusions, or comparisons to siblings like 'taskUpdate' (which might update the task itself) or 'taskStepAdd' (which adds steps). This lack of context makes it hard for an agent to choose correctly.

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