SuperAPI AI 工具集

notion

数据与分析

查看项目

更新于 10-16 08:33

技能介绍

用途:面向编辑排期与博客规划场景,访问 Notion 内容日历及页面数据。当用户询问内容日历、博客规划或相关页面内容时使用。

主要能力:getContentCalendar() 获取内容日历数据库全部条目;getNotionPage(pageId) 获取页面及其区块内容(递归);getContentCalendarSchema() 获取数据库结构/属性。对应 Agent 操作:content-calendar、content-calendar-schema、notion-page --pageId <id>。extractProp 可处理 Notion 各类属性(title、rich_text、select、multi_select、date、people、rollup、formula 等)。

使用方式:Base URL 为 https://api.notion.com/v1;鉴权用 Authorization: Bearer $NOTION_API_KEY,Notion-Version: 2022-06-28;环境变量 NOTION_API_KEY。内容日历与单个页面有 10 分钟缓存。内容日历分页通过 POST /databases/:id/query,page_size 为 100,配合 start_cursor。服务端库文件为 server/lib/notion.ts。注意:不要从 agent 直接调用 /api/notion/*。

限制:内容数据库 ID db4ae46c822443ba96e51a6a352e0fbe 与 API 版本为硬编码;fetchBlocks 在 has_children 为 true 时递归获取子级,对深层嵌套页面可能开销较大。其他细节暂未提供。