notion-automation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Notion 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
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    notion
  • Always call
    RUBE_SEARCH_TOOLS
    first to get current tool schemas
  • 已连接Rube MCP(可使用
    RUBE_SEARCH_TOOLS
  • 通过
    RUBE_MANAGE_CONNECTIONS
    完成Notion的活跃连接,工具包选择
    notion
  • 请始终先调用
    RUBE_SEARCH_TOOLS
    以获取最新的工具架构

Setup

设置步骤

Get Rube MCP: Add
https://rube.app/mcp
as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
  1. Verify Rube MCP is available by confirming
    RUBE_SEARCH_TOOLS
    responds
  2. Call
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    notion
  3. If connection is not ACTIVE, follow the returned auth link to complete Notion OAuth
  4. Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加
https://rube.app/mcp
作为MCP服务器。无需API密钥——只需添加该端点即可使用。
  1. 通过确认
    RUBE_SEARCH_TOOLS
    可响应,验证Rube MCP是否可用
  2. 调用
    RUBE_MANAGE_CONNECTIONS
    并指定工具包为
    notion
  3. 若连接状态未显示为ACTIVE,请跟随返回的授权链接完成Notion OAuth认证
  4. 在运行任何工作流之前,确认连接状态为ACTIVE

Core Workflows

核心工作流

1. Create and Manage Pages

1. 创建与管理页面

When to use: User wants to create, update, or archive Notion pages
Tool sequence:
  1. NOTION_SEARCH_NOTION_PAGE
    - Find parent page or existing page [Prerequisite]
  2. NOTION_CREATE_NOTION_PAGE
    - Create a new page under a parent [Optional]
  3. NOTION_RETRIEVE_PAGE
    - Get page metadata/properties [Optional]
  4. NOTION_UPDATE_PAGE
    - Update page properties, title, icon, cover [Optional]
  5. NOTION_ARCHIVE_NOTION_PAGE
    - Soft-delete (archive) a page [Optional]
Key parameters:
  • query
    : Search text for SEARCH_NOTION_PAGE
  • parent_id
    : Parent page or database ID
  • page_id
    : Page ID for retrieval/update/archive
  • properties
    : Page property values matching parent schema
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页面
工具执行序列
  1. NOTION_SEARCH_NOTION_PAGE
    - 查找父页面或已有页面【前置步骤】
  2. NOTION_CREATE_NOTION_PAGE
    - 在父页面下创建新页面【可选】
  3. NOTION_RETRIEVE_PAGE
    - 获取页面元数据/属性【可选】
  4. NOTION_UPDATE_PAGE
    - 更新页面属性、标题、图标、封面【可选】
  5. NOTION_ARCHIVE_NOTION_PAGE
    - 软删除(归档)页面【可选】
关键参数
  • query
    :
    SEARCH_NOTION_PAGE
    的搜索文本
  • parent_id
    : 父页面或数据库ID
  • page_id
    : 用于检索/更新/归档的页面ID
  • properties
    : 与父页面架构匹配的页面属性值
注意事项
  • RETRIEVE_PAGE
    仅返回元数据/属性,不包含页面正文内容;需使用
    FETCH_BLOCK_CONTENTS
    获取页面正文
  • ARCHIVE_NOTION_PAGE
    为软删除(设置archived=true),并非永久删除
  • 若未处理
    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:
  1. NOTION_SEARCH_NOTION_PAGE
    - Find the database by name [Prerequisite]
  2. NOTION_FETCH_DATABASE
    - Inspect schema and properties [Prerequisite]
  3. NOTION_QUERY_DATABASE
    /
    NOTION_QUERY_DATABASE_WITH_FILTER
    - Query rows [Required]
  4. NOTION_INSERT_ROW_DATABASE
    - Add new entries [Optional]
  5. NOTION_UPDATE_ROW_DATABASE
    - Update existing entries [Optional]
Key parameters:
  • database_id
    : Database ID (from search or URL)
  • filter
    : Filter object matching Notion filter syntax
  • sorts
    : Array of sort objects
  • start_cursor
    : Pagination cursor from previous response
  • properties
    : Property values matching database schema for inserts/updates
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)
适用场景:用户需要查询数据库行、插入条目或更新记录
工具执行序列
  1. NOTION_SEARCH_NOTION_PAGE
    - 通过名称查找数据库【前置步骤】
  2. NOTION_FETCH_DATABASE
    - 查看数据库架构与属性【前置步骤】
  3. NOTION_QUERY_DATABASE
    /
    NOTION_QUERY_DATABASE_WITH_FILTER
    - 查询行数据【必需】
  4. NOTION_INSERT_ROW_DATABASE
    - 添加新条目【可选】
  5. NOTION_UPDATE_ROW_DATABASE
    - 更新已有条目【可选】
关键参数
  • database_id
    : 数据库ID(来自搜索结果或页面URL)
  • filter
    : 符合Notion过滤语法的过滤对象
  • 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:
  1. NOTION_FETCH_BLOCK_CONTENTS
    - Read child blocks of a page [Required]
  2. NOTION_ADD_MULTIPLE_PAGE_CONTENT
    - Append blocks to a page [Optional]
  3. NOTION_APPEND_TEXT_BLOCKS
    - Append text-only blocks [Optional]
  4. NOTION_REPLACE_PAGE_CONTENT
    - Replace all page content [Optional]
  5. NOTION_DELETE_BLOCK
    - Remove a specific block [Optional]
Key parameters:
  • block_id
    /
    page_id
    : Target page or block ID
  • content_blocks
    : Array of block objects (NOT child_blocks)
  • text
    : Plain text content for APPEND_TEXT_BLOCKS
Pitfalls:
  • Use
    content_blocks
    parameter, NOT
    child_blocks
    -- the latter fails validation
  • 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
适用场景:用户需要读取、追加或修改页面中的内容块
工具执行序列
  1. NOTION_FETCH_BLOCK_CONTENTS
    - 读取页面的子块【必需】
  2. NOTION_ADD_MULTIPLE_PAGE_CONTENT
    - 向页面追加块【可选】
  3. NOTION_APPEND_TEXT_BLOCKS
    - 追加纯文本块【可选】
  4. NOTION_REPLACE_PAGE_CONTENT
    - 替换页面全部内容【可选】
  5. NOTION_DELETE_BLOCK
    - 删除指定块【可选】
关键参数
  • block_id
    /
    page_id
    : 目标页面或块的ID
  • content_blocks
    : 块对象数组(注意:不是
    child_blocks
  • text
    :
    APPEND_TEXT_BLOCKS
    使用的纯文本内容
注意事项
  • 请使用
    content_blocks
    参数,而非
    child_blocks
    ——后者会验证失败
  • ADD_MULTIPLE_PAGE_CONTENT
    在已归档页面上执行会失败;需先通过
    UPDATE_PAGE
    取消归档
  • 创建的块会在
    response.data.results
    中返回;请保存块ID以便后续编辑
  • DELETE_BLOCK
    为归档操作(archived=true),并非永久删除

4. Manage Database Schema

4. 管理数据库架构

When to use: User wants to create databases or modify their structure
Tool sequence:
  1. NOTION_FETCH_DATABASE
    - Inspect current schema [Prerequisite]
  2. NOTION_CREATE_DATABASE
    - Create a new database [Optional]
  3. NOTION_UPDATE_SCHEMA_DATABASE
    - Modify database properties [Optional]
Key parameters:
  • parent_id
    : Parent page ID for new databases
  • title
    : Database title
  • properties
    : Property definitions with types and options
  • database_id
    : Database ID for schema updates
Pitfalls:
  • Cannot change property types via UPDATE_SCHEMA; must create new property and migrate data
  • Formula, rollup, and relation properties have complex configuration requirements
适用场景:用户需要创建数据库或修改其结构
工具执行序列
  1. NOTION_FETCH_DATABASE
    - 查看当前架构【前置步骤】
  2. NOTION_CREATE_DATABASE
    - 创建新数据库【可选】
  3. NOTION_UPDATE_SCHEMA_DATABASE
    - 修改数据库属性【可选】
关键参数
  • parent_id
    : 新数据库的父页面ID
  • title
    : 数据库标题
  • properties
    : 包含类型与选项的属性定义
  • database_id
    : 用于架构更新的数据库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:
  1. NOTION_LIST_USERS
    - List all workspace users [Optional]
  2. NOTION_GET_ABOUT_ME
    - Get current authenticated user [Optional]
  3. NOTION_CREATE_COMMENT
    - Add a comment to a page [Optional]
  4. NOTION_FETCH_COMMENTS
    - List comments on a page [Optional]
Key parameters:
  • page_id
    : Page ID for comments (also called
    discussion_id
    )
  • rich_text
    : Comment content as rich text array
Pitfalls:
  • Comments are linked to pages, not individual blocks
  • User IDs from LIST_USERS are needed for people-type property filters
适用场景:用户需要列出工作区用户或管理页面评论
工具执行序列
  1. NOTION_LIST_USERS
    - 列出工作区所有用户【可选】
  2. NOTION_GET_ABOUT_ME
    - 获取当前已认证用户信息【可选】
  3. NOTION_CREATE_COMMENT
    - 向页面添加评论【可选】
  4. NOTION_FETCH_COMMENTS
    - 列出页面的评论【可选】
关键参数
  • page_id
    : 评论所属页面的ID(也称为
    discussion_id
  • rich_text
    : 富文本格式的评论内容数组
注意事项
  • 评论关联的是页面,而非单个块
  • LIST_USERS
    返回的用户ID用于人员类型属性的过滤条件

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 result
Database 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
    page_size
    for results per page (max 100)
  • Check response for
    has_more
    boolean
  • Pass
    start_cursor
    or
    next_cursor
    in next request
  • Continue until
    has_more
    is false
  • 设置
    page_size
    指定每页结果数量(最大100)
  • 检查响应中的
    has_more
    布尔值
  • 在下次请求中传入
    start_cursor
    next_cursor
  • 持续执行直到
    has_more
    为false

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
    data_preview
    or
    data.results
  • Parse defensively with fallbacks for different nesting levels
集成共享:
  • 页面与数据库必须共享给Notion集成应用才能被访问
  • 若条目未共享给集成应用,按标题查询会返回0条结果
属性类型:
  • 属性名称区分大小写,必须与架构完全匹配
  • 公式、汇总与创建时间字段为只读
  • 单选/多选字段的值必须匹配现有选项,除非创建新选项
响应解析:
  • 响应数据可能嵌套在
    data_preview
    data.results
  • 解析时需添加回退逻辑,适配不同的嵌套层级

Quick Reference

快速参考

TaskTool SlugKey Params
Search pages/databasesNOTION_SEARCH_NOTION_PAGEquery
Create pageNOTION_CREATE_NOTION_PAGEparent_id, properties
Get page metadataNOTION_RETRIEVE_PAGEpage_id
Update pageNOTION_UPDATE_PAGEpage_id, properties
Archive pageNOTION_ARCHIVE_NOTION_PAGEpage_id
Duplicate pageNOTION_DUPLICATE_PAGEpage_id
Get page blocksNOTION_FETCH_BLOCK_CONTENTSblock_id
Append blocksNOTION_ADD_MULTIPLE_PAGE_CONTENTpage_id, content_blocks
Append textNOTION_APPEND_TEXT_BLOCKSpage_id, text
Replace contentNOTION_REPLACE_PAGE_CONTENTpage_id, content_blocks
Delete blockNOTION_DELETE_BLOCKblock_id
Query databaseNOTION_QUERY_DATABASEdatabase_id, filter, sorts
Query with filterNOTION_QUERY_DATABASE_WITH_FILTERdatabase_id, filter
Insert rowNOTION_INSERT_ROW_DATABASEdatabase_id, properties
Update rowNOTION_UPDATE_ROW_DATABASEpage_id, properties
Get database schemaNOTION_FETCH_DATABASEdatabase_id
Create databaseNOTION_CREATE_DATABASEparent_id, title, properties
Update schemaNOTION_UPDATE_SCHEMA_DATABASEdatabase_id, properties
List usersNOTION_LIST_USERS(none)
Create commentNOTION_CREATE_COMMENTpage_id, rich_text
List commentsNOTION_FETCH_COMMENTSpage_id
任务工具标识关键参数
搜索页面/数据库NOTION_SEARCH_NOTION_PAGEquery
创建页面NOTION_CREATE_NOTION_PAGEparent_id, properties
获取页面元数据NOTION_RETRIEVE_PAGEpage_id
更新页面NOTION_UPDATE_PAGEpage_id, properties
归档页面NOTION_ARCHIVE_NOTION_PAGEpage_id
复制页面NOTION_DUPLICATE_PAGEpage_id
获取页面块NOTION_FETCH_BLOCK_CONTENTSblock_id
追加块NOTION_ADD_MULTIPLE_PAGE_CONTENTpage_id, content_blocks
追加文本NOTION_APPEND_TEXT_BLOCKSpage_id, text
替换内容NOTION_REPLACE_PAGE_CONTENTpage_id, content_blocks
删除块NOTION_DELETE_BLOCKblock_id
查询数据库NOTION_QUERY_DATABASEdatabase_id, filter, sorts
带过滤条件查询NOTION_QUERY_DATABASE_WITH_FILTERdatabase_id, filter
插入行NOTION_INSERT_ROW_DATABASEdatabase_id, properties
更新行NOTION_UPDATE_ROW_DATABASEpage_id, properties
获取数据库架构NOTION_FETCH_DATABASEdatabase_id
创建数据库NOTION_CREATE_DATABASEparent_id, title, properties
更新架构NOTION_UPDATE_SCHEMA_DATABASEdatabase_id, properties
列出用户NOTION_LIST_USERS
创建评论NOTION_CREATE_COMMENTpage_id, rich_text
列出评论NOTION_FETCH_COMMENTSpage_id

When to Use

适用场景

This skill is applicable to execute the workflow or actions described in the overview.
本技能适用于执行概述中描述的工作流或操作。