Skip to main content
Glama

taskSetAllSteps

Set completion status for all steps in a task by providing the task ID and desired completion state.

Instructions

設定某個任務所有步驟的完成狀態

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYes
completedYes

Implementation Reference

  • Core handler logic for setting all steps of a task to completed or incomplete status. Updates task steps in JSON storage, handles status logic, and logs reminders.
    public static async setAllStepsStatus(taskId: string, completed: boolean): 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];
    
      // 更新所有步驟狀態
      task.steps = task.steps.map(step => ({
        ...step,
        completed
      }));
    
      // 更新任務
      task.updatedAt = new Date().toISOString();
    
      // 當所有步驟完成時,提示使用completeTask來標記任務為已完成
      if (completed && task.status !== TaskStatus.COMPLETED) {
        // 不自動設置任務為完成狀態,僅顯示提示信息
        console.log(`任務 "${task.title}" 的所有步驟已完成,請使用 completeTask 方法將任務標記為已完成`);
      } else if (!completed && task.status === TaskStatus.COMPLETED) {
        // 如果將步驟設為未完成,且當前任務狀態為已完成,則將狀態改為進行中
        task.status = TaskStatus.IN_PROGRESS;
        // 移除實際完成時間
        delete task.actualCompletionDate;
      }
    
      // 保存所有任務
      await this.writeTasks(tasks);
    
      return task;
    }
  • main.ts:857-883 (registration)
    MCP server tool registration for 'taskSetAllSteps', including input schema (taskId, completed) and wrapper handler that calls TaskManagerTool.setAllStepsStatus and formats response.
    server.tool("taskSetAllSteps",
        "設定某個任務所有步驟的完成狀態",
        {
            taskId: z.string(),
            completed: z.boolean()
        },
        async ({ taskId, completed }) => {
            try {
                const updatedTask = await TaskManagerTool.setAllStepsStatus(taskId, completed);
    
                if (!updatedTask) {
                    return {
                        content: [{ type: "text", text: `未找到ID為 ${taskId} 的任務` }]
                    };
                }
    
                const status = completed ? '完成' : '未完成';
                return {
                    content: [{ type: "text", text: `任務「${updatedTask.title}」的所有步驟已設為${status}狀態:\n${JSON.stringify(updatedTask, null, 2)}` }]
                };
            } catch (error) {
                return {
                    content: [{ type: "text", text: `更新任務步驟狀態失敗: ${error instanceof Error ? error.message : "未知錯誤"}` }]
                };
            }
        }
    );
  • Zod input schema validation for the taskSetAllSteps tool.
        taskId: z.string(),
        completed: z.boolean()
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While '設定' implies a write/mutation operation, the description doesn't disclose important behavioral traits like whether this requires specific permissions, whether the operation is reversible, what happens to partially completed steps, or how this affects task status. For a mutation tool with zero annotation coverage, this represents significant gaps in behavioral 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 sentence that directly states the tool's purpose. There's no wasted language or unnecessary elaboration. The structure is front-loaded with the core functionality immediately apparent.

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 this is a mutation tool with no annotations, 0% schema description coverage, no output schema, and multiple sibling tools handling similar operations, the description is incomplete. It doesn't address key contextual questions about when to use this tool, what the parameters mean, what the behavior entails, or what the expected outcome is. The conciseness comes at the expense of necessary contextual information.

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?

With 0% schema description coverage and 2 parameters (taskId and completed), the description provides no parameter semantics beyond what's implied by the tool name. The description doesn't explain what format taskId should be in, what 'completed' means in context (marking all steps as done/undone), or any constraints on these parameters. The description fails to compensate for the complete lack of schema documentation.

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 clearly states the action ('設定' meaning 'set') and resource ('某個任務所有步驟的完成狀態' meaning 'completion status of all steps for a task'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like taskStepUpdate or taskUpdate, which handle individual steps or task properties respectively.

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. There are several sibling task-related tools (taskStepUpdate, taskUpdate, taskStepAdd, taskStepDelete) that handle similar operations, but the description offers no context about when this bulk step completion tool is preferred over individual step updates or other task modifications.

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