Skip to main content
Glama

update_task

Modify existing task details in Dida365, including title, due date, priority, and tags, by providing the task and project IDs.

Instructions

更新已有任务的信息,如标题、截止日期、优先级等。需要提供 task_id 和 project_id。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYes任务ID
project_idYes项目ID
titleNo新标题(可选)
contentNo新内容(可选)
due_dateNo新截止日期(可选,ISO 8601格式)
priorityNo新优先级(0=无, 1=低, 3=中, 5=高)
tagsNo新标签列表(可选)

Implementation Reference

  • The `update_task` method in the client class, which performs the actual API request to update a task.
    def update_task(
        self, task_id: str, project_id: str, **kwargs
    ) -> Dict:
        """
        更新任务
    
        Args:
            task_id: 任务ID
            project_id: 项目ID
            **kwargs: 要更新的字段
        """
        data: Dict[str, Any] = {"id": task_id, "projectId": project_id}
        field_map = {
            "title": "title",
            "content": "content",
            "desc": "desc",
            "start_date": "startDate",
            "due_date": "dueDate",
            "priority": "priority",
            "is_all_day": "isAllDay",
            "time_zone": "timeZone",
            "tags": "tags",
        }
        for key, api_key in field_map.items():
            if key in kwargs and kwargs[key] is not None:
                data[api_key] = kwargs[key]
    
        response = self.client.post(f"/task/{task_id}", json=data)
        response.raise_for_status()
        return response.json()
  • The dispatcher logic in `server.py` that receives the tool call and invokes the client's `update_task` method.
    elif name == "update_task":
        update_fields = {
            k: v
            for k, v in args.items()
            if k not in ("task_id", "project_id") and v is not None
        }
        task = client.update_task(
            task_id=args["task_id"],
            project_id=args["project_id"],
            **update_fields,
        )
        return "✅ 任务已更新!\n\n%s" % format_task(task)
  • MCP tool schema definition for `update_task`.
    {
        "name": "update_task",
        "description": "更新已有任务的信息,如标题、截止日期、优先级等。需要提供 task_id 和 project_id。",
        "inputSchema": {
            "type": "object",
            "properties": {
                "task_id": {"type": "string", "description": "任务ID"},
                "project_id": {"type": "string", "description": "项目ID"},
                "title": {"type": "string", "description": "新标题(可选)"},
                "content": {"type": "string", "description": "新内容(可选)"},
                "due_date": {
                    "type": "string",
                    "description": "新截止日期(可选,ISO 8601格式)",
                },
                "priority": {
                    "type": "integer",
                    "description": "新优先级(0=无, 1=低, 3=中, 5=高)",
                    "enum": [0, 1, 3, 5],
                },
                "tags": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "新标签列表(可选)",
                },
            },
            "required": ["task_id", "project_id"],
        },

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/Martinqi826/dida-mcp'

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