update_subtasks
Update subtask lists in Notion by rewriting the subtask block in a task's page body with new names, statuses, and priorities.
Instructions
更新任务的子目标列表(重写页面 body 中的子目标区块)。
Args: task_id: 任务的 Notion 页面 ID subtasks: 完整子目标列表 [{name: str, status: str, priority: str}] status: todo | doing | done priority: 🔴 紧急 | 🟡 高 | 🟢 普通
Returns: 更新后的子目标列表
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | ||
| subtasks | Yes |
Implementation Reference
- tools/workflow.py:267-289 (handler)The handler for 'update_subtasks' tool which validates input and calls the Notion client.
def update_subtasks(task_id: str, subtasks: list[dict]) -> list[dict]: """ 更新任务的子目标列表(重写页面 body 中的子目标区块)。 Args: task_id: 任务的 Notion 页面 ID subtasks: 完整子目标列表 [{name: str, status: str, priority: str}] status: todo | doing | done priority: 🔴 紧急 | 🟡 高 | 🟢 普通 Returns: 更新后的子目标列表 """ parsed = [ Subtask( name=s["name"], status=SubtaskStatus(s["status"]), priority=TaskPriority(s.get("priority", "🟢 普通")), ) for s in subtasks ] result = get_client().update_subtasks(task_id, parsed) return [s.model_dump() for s in result]