Skip to main content
Glama

taskUpdate

Update existing task information in GonMCPtool, including title, description, due date, priority, status, and tags.

Instructions

更新現有任務信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
updatesYes

Implementation Reference

  • Core implementation of the taskUpdate functionality. Loads tasks from JSON file, finds the task by ID, applies updates (excluding id and createdAt, prevents setting to COMPLETED), updates timestamp, and persists changes.
    public static async updateTask(id: string, updates: Partial<Omit<Task, 'id' | 'createdAt'>>): Promise<Task | null> {
      const tasks = await this.readTasks();
      const taskIndex = tasks.findIndex(t => t.id === id);
    
      if (taskIndex === -1) {
        return null;
      }
    
      // 檢查是否嘗試將任務設置為已完成狀態
      if (updates.status === TaskStatus.COMPLETED) {
        throw new Error('不能使用 updateTask 方法將任務標記為已完成,請使用 completeTask 方法');
      }
    
      // 更新任務
      tasks[taskIndex] = {
        ...tasks[taskIndex],
        ...updates,
        updatedAt: new Date().toISOString()
      };
    
      // 保存所有任務
      await this.writeTasks(tasks);
    
      return tasks[taskIndex];
    }
  • main.ts:647-684 (registration)
    MCP tool registration for 'taskUpdate', including Zod input schema validation and thin wrapper handler that calls TaskManagerTool.updateTask and formats response.
    server.tool("taskUpdate",
        "更新現有任務信息",
        {
            id: z.string(),
            updates: z.object({
                title: z.string().optional(),
                description: z.string().optional(),
                tags: z.array(z.string()).optional(),
                dueDate: z.string().optional(),
                priority: z.number().optional(),
                status: z.enum([
                    TaskStatus.PENDING,
                    TaskStatus.IN_PROGRESS,
                    TaskStatus.COMPLETED,
                    TaskStatus.CANCELLED
                ]).optional()
            })
        },
        async ({ id, updates }) => {
            try {
                const updatedTask = await TaskManagerTool.updateTask(id, updates);
    
                if (!updatedTask) {
                    return {
                        content: [{ type: "text", text: `未找到ID為 ${id} 的任務` }]
                    };
                }
    
                return {
                    content: [{ type: "text", text: `任務更新成功:\n${JSON.stringify(updatedTask, null, 2)}` }]
                };
            } catch (error) {
                return {
                    content: [{ type: "text", text: `更新任務失敗: ${error instanceof Error ? error.message : "未知錯誤"}` }]
                };
            }
        }
    );
  • Zod schema defining input parameters for taskUpdate tool: task ID and optional updates for title, description, tags, dueDate, priority, status.
    {
        id: z.string(),
        updates: z.object({
            title: z.string().optional(),
            description: z.string().optional(),
            tags: z.array(z.string()).optional(),
            dueDate: z.string().optional(),
            priority: z.number().optional(),
            status: z.enum([
                TaskStatus.PENDING,
                TaskStatus.IN_PROGRESS,
                TaskStatus.COMPLETED,
                TaskStatus.CANCELLED
            ]).optional()
        })
    },
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. It states it's an update operation, implying mutation, but doesn't cover critical aspects like required permissions, whether changes are reversible, error handling (e.g., invalid ID), or response format. For a mutation tool with zero annotation coverage, this is a significant gap.

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 with zero wasted words. It's appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

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 (mutation with 2 parameters, nested objects, no output schema, and no annotations), the description is incomplete. It lacks details on parameter usage, behavioral traits, error conditions, and output expectations, making it inadequate for safe and effective use by an AI agent.

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?

Schema description coverage is 0%, so the description must compensate. It mentions 'task information' but doesn't specify what fields can be updated (e.g., title, status). The two parameters (id and updates) are undocumented in both schema and description, leaving their purpose unclear. The description adds minimal value beyond the schema.

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 existing task information) clearly states the verb ('update') and resource ('existing task information'), but it's vague about what specific aspects can be updated. It doesn't distinguish from sibling tools like taskStepUpdate or taskSetAllSteps, which also modify task-related data.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid task ID), exclusions, or comparisons to sibling tools like taskCreate (for new tasks) or taskStepUpdate (for modifying steps). The description alone offers no usage context.

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