list_tasks
Retrieve and filter tasks from your Notion workflow database by status, priority, tag, or project to manage your tasks effectively.
Instructions
列出工作流库中的任务。
Args: status: 按状态过滤,可选值:待办 | 进行中 | 完成 | 搁置 priority: 按优先级过滤,可选值:🔴 紧急 | 🟡 高 | 🟢 普通 tag: 按标签过滤,精确匹配单个标签名称 limit: 返回条数,默认 20,最大 100 project: 按项目过滤,精确匹配项目名称
Returns: 任务列表(字典格式)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | ||
| priority | No | ||
| tag | No | ||
| limit | No | ||
| project | No |
Implementation Reference
- tools/workflow.py:27-55 (handler)The MCP tool handler for 'list_tasks' defined in tools/workflow.py, which translates input arguments and calls the underlying client.list_tasks.
def list_tasks( status: Optional[str] = None, priority: Optional[str] = None, tag: Optional[str] = None, limit: int = 20, project: Optional[str] = None, ) -> list[dict]: """ 列出工作流库中的任务。 Args: status: 按状态过滤,可选值:待办 | 进行中 | 完成 | 搁置 priority: 按优先级过滤,可选值:🔴 紧急 | 🟡 高 | 🟢 普通 tag: 按标签过滤,精确匹配单个标签名称 limit: 返回条数,默认 20,最大 100 project: 按项目过滤,精确匹配项目名称 Returns: 任务列表(字典格式) """ client = get_client() tasks = client.list_tasks( status=TaskStatus(status) if status else None, priority=TaskPriority(priority) if priority else None, tag=tag, limit=limit, project=project, ) return [t.model_dump() for t in tasks] - server.py:36-36 (registration)Registration of the 'list_tasks' tool in the MCP server.
mcp.tool(list_tasks)