Skip to main content
Glama

get_today_tasks

Retrieve today's tasks from Notion, including due items and ongoing work, sorted by priority for daily workflow management.

Instructions

获取今日相关任务:今天到期的任务 + 所有进行中的任务。

Returns: 任务列表,按优先级排序

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The tool handler for "get_today_tasks", which calls the underlying Notion client and formats the result.
    def get_today_tasks() -> list[dict]:
        """
        获取今日相关任务:今天到期的任务 + 所有进行中的任务。
    
        Returns:
            任务列表,按优先级排序
        """
        tasks = get_client().get_today_tasks()
        return [t.model_dump() for t in tasks]
  • The implementation of the logic for fetching today's tasks from the Notion API.
    def get_today_tasks(self) -> list[Task]:
        today = datetime.now(timezone.utc).date().isoformat()
        tomorrow = (datetime.now(timezone.utc).date() + timedelta(days=1)).isoformat()
    
        response = self.client.data_sources.query(
            data_source_id=self.workflow_db_id,
            filter={
                "or": [
                    {
                        "property": "状态",
                        "select": {"equals": TaskStatus.IN_PROGRESS.value},
                    },
                    {
                        "and": [
                            {"property": "截止日期", "date": {"on_or_after": today}},
                            {"property": "截止日期", "date": {"before": tomorrow}},
                        ]
                    },
                ]
            },
            sorts=[{"property": "优先级", "direction": "ascending"}],
            page_size=30,
        )
        return [self._parse_task(p) for p in response["results"]]
  • server.py:56-56 (registration)
    Registration of the get_today_tasks function as an MCP tool.
    mcp.tool(get_today_tasks)

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/wauwaya/notion-workflow-mcp'

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