notion-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNotion Automation via Rube MCP
通过Rube MCP实现Notion自动化
Automate Notion operations through Composio's Notion toolkit via Rube MCP.
通过Rube MCP,借助Composio的Notion工具包自动化Notion操作。
Prerequisites
前提条件
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Notion connection via with toolkit
RUBE_MANAGE_CONNECTIONSnotion - Always call first to get current tool schemas
RUBE_SEARCH_TOOLS
- 已连接Rube MCP(可使用)
RUBE_SEARCH_TOOLS - 通过完成Notion的活跃连接,工具包选择
RUBE_MANAGE_CONNECTIONSnotion - 请始终先调用以获取最新的工具架构
RUBE_SEARCH_TOOLS
Setup
设置步骤
Get Rube MCP: Add as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
https://rube.app/mcp- Verify Rube MCP is available by confirming responds
RUBE_SEARCH_TOOLS - Call with toolkit
RUBE_MANAGE_CONNECTIONSnotion - If connection is not ACTIVE, follow the returned auth link to complete Notion OAuth
- Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加作为MCP服务器。无需API密钥——只需添加该端点即可使用。
https://rube.app/mcp- 通过确认可响应,验证Rube MCP是否可用
RUBE_SEARCH_TOOLS - 调用并指定工具包为
RUBE_MANAGE_CONNECTIONSnotion - 若连接状态未显示为ACTIVE,请跟随返回的授权链接完成Notion OAuth认证
- 在运行任何工作流之前,确认连接状态为ACTIVE
Core Workflows
核心工作流
1. Create and Manage Pages
1. 创建与管理页面
When to use: User wants to create, update, or archive Notion pages
Tool sequence:
- - Find parent page or existing page [Prerequisite]
NOTION_SEARCH_NOTION_PAGE - - Create a new page under a parent [Optional]
NOTION_CREATE_NOTION_PAGE - - Get page metadata/properties [Optional]
NOTION_RETRIEVE_PAGE - - Update page properties, title, icon, cover [Optional]
NOTION_UPDATE_PAGE - - Soft-delete (archive) a page [Optional]
NOTION_ARCHIVE_NOTION_PAGE
Key parameters:
- : Search text for SEARCH_NOTION_PAGE
query - : Parent page or database ID
parent_id - : Page ID for retrieval/update/archive
page_id - : Page property values matching parent schema
properties
Pitfalls:
- RETRIEVE_PAGE returns only metadata/properties, NOT body content; use FETCH_BLOCK_CONTENTS for page body
- ARCHIVE_NOTION_PAGE is a soft-delete (sets archived=true), not permanent deletion
- Broad searches can look incomplete unless has_more/next_cursor is fully paginated
适用场景:用户需要创建、更新或归档Notion页面
工具执行序列:
- - 查找父页面或已有页面【前置步骤】
NOTION_SEARCH_NOTION_PAGE - - 在父页面下创建新页面【可选】
NOTION_CREATE_NOTION_PAGE - - 获取页面元数据/属性【可选】
NOTION_RETRIEVE_PAGE - - 更新页面属性、标题、图标、封面【可选】
NOTION_UPDATE_PAGE - - 软删除(归档)页面【可选】
NOTION_ARCHIVE_NOTION_PAGE
关键参数:
- :
query的搜索文本SEARCH_NOTION_PAGE - : 父页面或数据库ID
parent_id - : 用于检索/更新/归档的页面ID
page_id - : 与父页面架构匹配的页面属性值
properties
注意事项:
- 仅返回元数据/属性,不包含页面正文内容;需使用
RETRIEVE_PAGE获取页面正文FETCH_BLOCK_CONTENTS - 为软删除(设置archived=true),并非永久删除
ARCHIVE_NOTION_PAGE - 若未处理进行分页,宽泛搜索的结果可能不完整
has_more/next_cursor
2. Query and Manage Databases
2. 查询与管理数据库
When to use: User wants to query database rows, insert entries, or update records
Tool sequence:
- - Find the database by name [Prerequisite]
NOTION_SEARCH_NOTION_PAGE - - Inspect schema and properties [Prerequisite]
NOTION_FETCH_DATABASE - /
NOTION_QUERY_DATABASE- Query rows [Required]NOTION_QUERY_DATABASE_WITH_FILTER - - Add new entries [Optional]
NOTION_INSERT_ROW_DATABASE - - Update existing entries [Optional]
NOTION_UPDATE_ROW_DATABASE
Key parameters:
- : Database ID (from search or URL)
database_id - : Filter object matching Notion filter syntax
filter - : Array of sort objects
sorts - : Pagination cursor from previous response
start_cursor - : Property values matching database schema for inserts/updates
properties
Pitfalls:
- 404 object_not_found usually means wrong database_id or the database is not shared with the integration
- Results are paginated; ignoring has_more/next_cursor silently truncates reads
- Schema mismatches or missing required properties cause 400 validation_error
- Formula and read-only fields cannot be set via INSERT_ROW_DATABASE
- Property names in filters must match schema exactly (case-sensitive)
适用场景:用户需要查询数据库行、插入条目或更新记录
工具执行序列:
- - 通过名称查找数据库【前置步骤】
NOTION_SEARCH_NOTION_PAGE - - 查看数据库架构与属性【前置步骤】
NOTION_FETCH_DATABASE - /
NOTION_QUERY_DATABASE- 查询行数据【必需】NOTION_QUERY_DATABASE_WITH_FILTER - - 添加新条目【可选】
NOTION_INSERT_ROW_DATABASE - - 更新已有条目【可选】
NOTION_UPDATE_ROW_DATABASE
关键参数:
- : 数据库ID(来自搜索结果或页面URL)
database_id - : 符合Notion过滤语法的过滤对象
filter - : 排序对象数组
sorts - : 来自上一次响应的分页游标
start_cursor - : 与数据库架构匹配的属性值(用于插入/更新)
properties
注意事项:
- 出现404 object_not_found错误通常意味着database_id错误,或数据库未共享给集成应用
- 结果为分页返回;若忽略,会导致读取结果被静默截断
has_more/next_cursor - 架构不匹配或缺少必填属性会触发400 validation_error错误
- 公式字段和只读字段无法通过设置
INSERT_ROW_DATABASE - 过滤条件中的属性名称必须与架构完全匹配(区分大小写)
3. Manage Blocks and Page Content
3. 管理块与页面内容
When to use: User wants to read, append, or modify content blocks in a page
Tool sequence:
- - Read child blocks of a page [Required]
NOTION_FETCH_BLOCK_CONTENTS - - Append blocks to a page [Optional]
NOTION_ADD_MULTIPLE_PAGE_CONTENT - - Append text-only blocks [Optional]
NOTION_APPEND_TEXT_BLOCKS - - Replace all page content [Optional]
NOTION_REPLACE_PAGE_CONTENT - - Remove a specific block [Optional]
NOTION_DELETE_BLOCK
Key parameters:
- /
block_id: Target page or block IDpage_id - : Array of block objects (NOT child_blocks)
content_blocks - : Plain text content for APPEND_TEXT_BLOCKS
text
Pitfalls:
- Use parameter, NOT
content_blocks-- the latter fails validationchild_blocks - ADD_MULTIPLE_PAGE_CONTENT fails on archived pages; unarchive via UPDATE_PAGE first
- Created blocks are in response.data.results; persist block IDs for later edits
- DELETE_BLOCK is archival (archived=true), not permanent deletion
适用场景:用户需要读取、追加或修改页面中的内容块
工具执行序列:
- - 读取页面的子块【必需】
NOTION_FETCH_BLOCK_CONTENTS - - 向页面追加块【可选】
NOTION_ADD_MULTIPLE_PAGE_CONTENT - - 追加纯文本块【可选】
NOTION_APPEND_TEXT_BLOCKS - - 替换页面全部内容【可选】
NOTION_REPLACE_PAGE_CONTENT - - 删除指定块【可选】
NOTION_DELETE_BLOCK
关键参数:
- /
block_id: 目标页面或块的IDpage_id - : 块对象数组(注意:不是
content_blocks)child_blocks - :
text使用的纯文本内容APPEND_TEXT_BLOCKS
注意事项:
- 请使用参数,而非
content_blocks——后者会验证失败child_blocks - 在已归档页面上执行会失败;需先通过
ADD_MULTIPLE_PAGE_CONTENT取消归档UPDATE_PAGE - 创建的块会在中返回;请保存块ID以便后续编辑
response.data.results - 为归档操作(archived=true),并非永久删除
DELETE_BLOCK
4. Manage Database Schema
4. 管理数据库架构
When to use: User wants to create databases or modify their structure
Tool sequence:
- - Inspect current schema [Prerequisite]
NOTION_FETCH_DATABASE - - Create a new database [Optional]
NOTION_CREATE_DATABASE - - Modify database properties [Optional]
NOTION_UPDATE_SCHEMA_DATABASE
Key parameters:
- : Parent page ID for new databases
parent_id - : Database title
title - : Property definitions with types and options
properties - : Database ID for schema updates
database_id
Pitfalls:
- Cannot change property types via UPDATE_SCHEMA; must create new property and migrate data
- Formula, rollup, and relation properties have complex configuration requirements
适用场景:用户需要创建数据库或修改其结构
工具执行序列:
- - 查看当前架构【前置步骤】
NOTION_FETCH_DATABASE - - 创建新数据库【可选】
NOTION_CREATE_DATABASE - - 修改数据库属性【可选】
NOTION_UPDATE_SCHEMA_DATABASE
关键参数:
- : 新数据库的父页面ID
parent_id - : 数据库标题
title - : 包含类型与选项的属性定义
properties - : 用于架构更新的数据库ID
database_id
注意事项:
- 无法通过更改属性类型;需创建新属性并迁移数据
UPDATE_SCHEMA - 公式、汇总与关联属性的配置要求较为复杂
5. Manage Users and Comments
5. 管理用户与评论
When to use: User wants to list workspace users or manage comments on pages
Tool sequence:
- - List all workspace users [Optional]
NOTION_LIST_USERS - - Get current authenticated user [Optional]
NOTION_GET_ABOUT_ME - - Add a comment to a page [Optional]
NOTION_CREATE_COMMENT - - List comments on a page [Optional]
NOTION_FETCH_COMMENTS
Key parameters:
- : Page ID for comments (also called
page_id)discussion_id - : Comment content as rich text array
rich_text
Pitfalls:
- Comments are linked to pages, not individual blocks
- User IDs from LIST_USERS are needed for people-type property filters
适用场景:用户需要列出工作区用户或管理页面评论
工具执行序列:
- - 列出工作区所有用户【可选】
NOTION_LIST_USERS - - 获取当前已认证用户信息【可选】
NOTION_GET_ABOUT_ME - - 向页面添加评论【可选】
NOTION_CREATE_COMMENT - - 列出页面的评论【可选】
NOTION_FETCH_COMMENTS
关键参数:
- : 评论所属页面的ID(也称为
page_id)discussion_id - : 富文本格式的评论内容数组
rich_text
注意事项:
- 评论关联的是页面,而非单个块
- 返回的用户ID用于人员类型属性的过滤条件
LIST_USERS
Common Patterns
常见模式
ID Resolution
ID解析
Page/Database name -> ID:
1. Call NOTION_SEARCH_NOTION_PAGE with query=name
2. Paginate with has_more/next_cursor until found
3. Extract id from matching resultDatabase schema inspection:
1. Call NOTION_FETCH_DATABASE with database_id
2. Extract properties object for field names and types
3. Use exact property names in queries and inserts页面/数据库名称 -> ID:
1. 调用NOTION_SEARCH_NOTION_PAGE,参数query=名称
2. 使用has_more/next_cursor进行分页,直到找到目标
3. 从匹配结果中提取id数据库架构查看:
1. 调用NOTION_FETCH_DATABASE,参数database_id
2. 提取properties对象以获取字段名称与类型
3. 在查询与插入操作中使用完全匹配的属性名称Pagination
分页处理
- Set for results per page (max 100)
page_size - Check response for boolean
has_more - Pass or
start_cursorin next requestnext_cursor - Continue until is false
has_more
- 设置指定每页结果数量(最大100)
page_size - 检查响应中的布尔值
has_more - 在下次请求中传入或
start_cursornext_cursor - 持续执行直到为false
has_more
Notion Filter Syntax
Notion过滤语法
Single filter:
json
{"property": "Status", "select": {"equals": "Done"}}Compound filter:
json
{"and": [
{"property": "Status", "select": {"equals": "In Progress"}},
{"property": "Assignee", "people": {"contains": "user-id"}}
]}单个过滤条件:
json
{"property": "Status", "select": {"equals": "Done"}}复合过滤条件:
json
{"and": [
{"property": "Status", "select": {"equals": "In Progress"}},
{"property": "Assignee", "people": {"contains": "user-id"}}
]}Known Pitfalls
已知注意事项
Integration Sharing:
- Pages and databases must be shared with the Notion integration to be accessible
- Title queries can return 0 when the item is not shared with the integration
Property Types:
- Property names are case-sensitive and must match schema exactly
- Formula, rollup, and created_time fields are read-only
- Select/multi-select values must match existing options unless creating new ones
Response Parsing:
- Response data may be nested under or
data_previewdata.results - Parse defensively with fallbacks for different nesting levels
集成共享:
- 页面与数据库必须共享给Notion集成应用才能被访问
- 若条目未共享给集成应用,按标题查询会返回0条结果
属性类型:
- 属性名称区分大小写,必须与架构完全匹配
- 公式、汇总与创建时间字段为只读
- 单选/多选字段的值必须匹配现有选项,除非创建新选项
响应解析:
- 响应数据可能嵌套在或
data_preview下data.results - 解析时需添加回退逻辑,适配不同的嵌套层级
Quick Reference
快速参考
| Task | Tool Slug | Key Params |
|---|---|---|
| Search pages/databases | NOTION_SEARCH_NOTION_PAGE | query |
| Create page | NOTION_CREATE_NOTION_PAGE | parent_id, properties |
| Get page metadata | NOTION_RETRIEVE_PAGE | page_id |
| Update page | NOTION_UPDATE_PAGE | page_id, properties |
| Archive page | NOTION_ARCHIVE_NOTION_PAGE | page_id |
| Duplicate page | NOTION_DUPLICATE_PAGE | page_id |
| Get page blocks | NOTION_FETCH_BLOCK_CONTENTS | block_id |
| Append blocks | NOTION_ADD_MULTIPLE_PAGE_CONTENT | page_id, content_blocks |
| Append text | NOTION_APPEND_TEXT_BLOCKS | page_id, text |
| Replace content | NOTION_REPLACE_PAGE_CONTENT | page_id, content_blocks |
| Delete block | NOTION_DELETE_BLOCK | block_id |
| Query database | NOTION_QUERY_DATABASE | database_id, filter, sorts |
| Query with filter | NOTION_QUERY_DATABASE_WITH_FILTER | database_id, filter |
| Insert row | NOTION_INSERT_ROW_DATABASE | database_id, properties |
| Update row | NOTION_UPDATE_ROW_DATABASE | page_id, properties |
| Get database schema | NOTION_FETCH_DATABASE | database_id |
| Create database | NOTION_CREATE_DATABASE | parent_id, title, properties |
| Update schema | NOTION_UPDATE_SCHEMA_DATABASE | database_id, properties |
| List users | NOTION_LIST_USERS | (none) |
| Create comment | NOTION_CREATE_COMMENT | page_id, rich_text |
| List comments | NOTION_FETCH_COMMENTS | page_id |
| 任务 | 工具标识 | 关键参数 |
|---|---|---|
| 搜索页面/数据库 | NOTION_SEARCH_NOTION_PAGE | query |
| 创建页面 | NOTION_CREATE_NOTION_PAGE | parent_id, properties |
| 获取页面元数据 | NOTION_RETRIEVE_PAGE | page_id |
| 更新页面 | NOTION_UPDATE_PAGE | page_id, properties |
| 归档页面 | NOTION_ARCHIVE_NOTION_PAGE | page_id |
| 复制页面 | NOTION_DUPLICATE_PAGE | page_id |
| 获取页面块 | NOTION_FETCH_BLOCK_CONTENTS | block_id |
| 追加块 | NOTION_ADD_MULTIPLE_PAGE_CONTENT | page_id, content_blocks |
| 追加文本 | NOTION_APPEND_TEXT_BLOCKS | page_id, text |
| 替换内容 | NOTION_REPLACE_PAGE_CONTENT | page_id, content_blocks |
| 删除块 | NOTION_DELETE_BLOCK | block_id |
| 查询数据库 | NOTION_QUERY_DATABASE | database_id, filter, sorts |
| 带过滤条件查询 | NOTION_QUERY_DATABASE_WITH_FILTER | database_id, filter |
| 插入行 | NOTION_INSERT_ROW_DATABASE | database_id, properties |
| 更新行 | NOTION_UPDATE_ROW_DATABASE | page_id, properties |
| 获取数据库架构 | NOTION_FETCH_DATABASE | database_id |
| 创建数据库 | NOTION_CREATE_DATABASE | parent_id, title, properties |
| 更新架构 | NOTION_UPDATE_SCHEMA_DATABASE | database_id, properties |
| 列出用户 | NOTION_LIST_USERS | 无 |
| 创建评论 | NOTION_CREATE_COMMENT | page_id, rich_text |
| 列出评论 | NOTION_FETCH_COMMENTS | page_id |
When to Use
适用场景
This skill is applicable to execute the workflow or actions described in the overview.
本技能适用于执行概述中描述的工作流或操作。