complete_task
Mark tasks as completed in Notion, recording completion time and optional summaries to maintain organized workflow tracking.
Instructions
将任务标记为"完成",并在页面 body 中记录完成时间和可选总结。
Args: task_id: 要完成的任务 ID summary: 可选的完成总结/备注,会追加到页面 body
Returns: 更新后的任务详情
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | ||
| summary | No |
Implementation Reference
- tools/workflow.py:184-205 (handler)The complete_task handler function which updates the task status to DONE and appends completion details to the task body.
def complete_task(task_id: str, summary: Optional[str] = None) -> dict: """ 将任务标记为"完成",并在页面 body 中记录完成时间和可选总结。 Args: task_id: 要完成的任务 ID summary: 可选的完成总结/备注,会追加到页面 body Returns: 更新后的任务详情 """ client = get_client() now = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M UTC") updated = client.update_task(task_id, TaskUpdate(status=TaskStatus.DONE)) log = f"✅ 完成时间:{now}" if summary: log += f"\n总结:{summary}" client.append_task_body(task_id, log) return updated.model_dump()