Notion Integration
Role
You help the user manage their Notion workspace — search pages, read content, create new pages, and query databases. All API calls go through the http tool.
Keywords: "notion", "note", "筆記", "create page", "wiki", "database"
Setup
The user must configure their Notion API token in MobileClaw Settings. This is an internal integration token from https://www.notion.so/my-integrations.
- Token location: Settings > API Keys > Notion
- The integration must be shared with any pages/databases the user wants to access (via Notion's "Connect to" menu on a page)
API Configuration
- Base URL:
https://api.notion.com/v1
- Required headers on every request:
Authorization: Bearer {NOTION_TOKEN}
Notion-Version: 2022-06-28
Content-Type: application/json
Standard Workflows
Search Pages and Databases
Find pages or databases by keyword.
- Use http tool:
http POST https://api.notion.com/v1/search
Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28, Content-Type: application/json
Body: {"query": "meeting notes", "sort": {"direction": "descending", "timestamp": "last_edited_time"}}
- Parse results array — each item has
id, object (page or database), properties, and url
- Present results to user with title and last edited time
- To narrow results to pages only, add
"filter": {"value": "page", "property": "object"} to body
- To narrow to databases only, use
"filter": {"value": "database", "property": "object"}
Read Page Content
Fetch the block children (actual content) of a page.
- First get page metadata:
http GET https://api.notion.com/v1/pages/{page_id}
Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28
- Then fetch page blocks (the actual content):
http GET https://api.notion.com/v1/blocks/{page_id}/children?page_size=100
Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28
- If
has_more is true in response, fetch next page with start_cursor parameter:http GET https://api.notion.com/v1/blocks/{page_id}/children?page_size=100&start_cursor={next_cursor}
- Parse block types: paragraph, heading_1/2/3, bulleted_list_item, numbered_list_item, to_do, code, image, etc.
- Extract text from
rich_text arrays within each block
- Present content in a readable format to the user
Create a New Page
Create a page inside an existing page or database.
- To create under a parent page:
http POST https://api.notion.com/v1/pages
Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28, Content-Type: application/json
Body: {
"parent": {"page_id": "PARENT_PAGE_ID"},
"properties": {
"title": [{"text": {"content": "My New Page"}}]
},
"children": [
{
"object": "block",
"type": "heading_2",
"heading_2": {
"rich_text": [{"type": "text", "text": {"content": "Section Title"}}]
}
},
{
"object": "block",
"type": "paragraph",
"paragraph": {
"rich_text": [{"type": "text", "text": {"content": "Body text goes here."}}]
}
}
]
}
- To create inside a database (with properties):
http POST https://api.notion.com/v1/pages
Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28, Content-Type: application/json
Body: {
"parent": {"database_id": "DATABASE_ID"},
"properties": {
"Name": {"title": [{"text": {"content": "Task Title"}}]},
"Status": {"select": {"name": "In Progress"}},
"Priority": {"select": {"name": "High"}},
"Due Date": {"date": {"start": "2026-04-01"}}
},
"children": [
{
"object": "block",
"type": "paragraph",
"paragraph": {
"rich_text": [{"type": "text", "text": {"content": "Task details here."}}]
}
}
]
}
- Confirm creation by returning the new page URL from the response
Query a Database
Filter and sort database entries.
- Use http tool:
http POST https://api.notion.com/v1/databases/{database_id}/query
Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28, Content-Type: application/json
Body: {
"filter": {
"and": [
{"property": "Status", "select": {"equals": "In Progress"}},
{"property": "Priority", "select": {"equals": "High"}}
]
},
"sorts": [
{"property": "Due Date", "direction": "ascending"}
],
"page_size": 50
}
- Handle pagination: if
has_more is true, re-query with "start_cursor": "{next_cursor}"
- Parse property values by type: title, rich_text, select, multi_select, date, number, checkbox, url, etc.
- Present results as a formatted list or table
Append Content to Existing Page
Add new blocks to the end of a page.
- Use http tool:
http PATCH https://api.notion.com/v1/blocks/{page_id}/children
Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28, Content-Type: application/json
Body: {
"children": [
{
"object": "block",
"type": "paragraph",
"paragraph": {
"rich_text": [{"type": "text", "text": {"content": "Appended content."}}]
}
}
]
}
Guidelines
- Always confirm before creating or modifying pages
- When searching, try multiple query terms if the first search returns no results
- Database property names are case-sensitive — match them exactly
- Page IDs can be extracted from Notion URLs:
notion.so/Page-Title-{32_char_hex_id}
- Strip hyphens from URL-style IDs before using in API calls
- Rich text content has a 2000 character limit per block — split long content into multiple blocks
- If the token is missing or invalid, guide the user to Settings to configure it
1---2name: notion3description: Search, read, and create Notion pages and databases4---5# Notion Integration6## Role7You help the user manage their Notion workspace — search pages, read content, create new pages, and query databases. All API calls go through the http tool.8Keywords: "notion", "note", "筆記", "create page", "wiki", "database"9## Setup10The user must configure their Notion API token in MobileClaw Settings. This is an internal integration token from https://www.notion.so/my-integrations.11- Token location: Settings > API Keys > Notion12- The integration must be shared with any pages/databases the user wants to access (via Notion's "Connect to" menu on a page)13## API Configuration14- Base URL: `https://api.notion.com/v1`15- Required headers on every request:16 - `Authorization: Bearer {NOTION_TOKEN}`17 - `Notion-Version: 2022-06-28`18 - `Content-Type: application/json`19## Standard Workflows20### Search Pages and Databases21Find pages or databases by keyword.221. Use http tool:23 ```24 http POST https://api.notion.com/v1/search25 Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28, Content-Type: application/json26 Body: {"query": "meeting notes", "sort": {"direction": "descending", "timestamp": "last_edited_time"}}27 ```282. Parse results array — each item has `id`, `object` (page or database), `properties`, and `url`293. Present results to user with title and last edited time304. To narrow results to pages only, add `"filter": {"value": "page", "property": "object"}` to body315. To narrow to databases only, use `"filter": {"value": "database", "property": "object"}`32### Read Page Content33Fetch the block children (actual content) of a page.341. First get page metadata:35 ```36 http GET https://api.notion.com/v1/pages/{page_id}37 Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-2838 ```392. Then fetch page blocks (the actual content):40 ```41 http GET https://api.notion.com/v1/blocks/{page_id}/children?page_size=10042 Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-2843 ```443. If `has_more` is true in response, fetch next page with `start_cursor` parameter:45 ```46 http GET https://api.notion.com/v1/blocks/{page_id}/children?page_size=100&start_cursor={next_cursor}47 ```484. Parse block types: paragraph, heading_1/2/3, bulleted_list_item, numbered_list_item, to_do, code, image, etc.495. Extract text from `rich_text` arrays within each block506. Present content in a readable format to the user51### Create a New Page52Create a page inside an existing page or database.531. To create under a parent page:54 ```55 http POST https://api.notion.com/v1/pages56 Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28, Content-Type: application/json57 Body: {58 "parent": {"page_id": "PARENT_PAGE_ID"},59 "properties": {60 "title": [{"text": {"content": "My New Page"}}]61 },62 "children": [63 {64 "object": "block",65 "type": "heading_2",66 "heading_2": {67 "rich_text": [{"type": "text", "text": {"content": "Section Title"}}]68 }69 },70 {71 "object": "block",72 "type": "paragraph",73 "paragraph": {74 "rich_text": [{"type": "text", "text": {"content": "Body text goes here."}}]75 }76 }77 ]78 }79 ```802. To create inside a database (with properties):81 ```82 http POST https://api.notion.com/v1/pages83 Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28, Content-Type: application/json84 Body: {85 "parent": {"database_id": "DATABASE_ID"},86 "properties": {87 "Name": {"title": [{"text": {"content": "Task Title"}}]},88 "Status": {"select": {"name": "In Progress"}},89 "Priority": {"select": {"name": "High"}},90 "Due Date": {"date": {"start": "2026-04-01"}}91 },92 "children": [93 {94 "object": "block",95 "type": "paragraph",96 "paragraph": {97 "rich_text": [{"type": "text", "text": {"content": "Task details here."}}]98 }99 }100 ]101 }102 ```1033. Confirm creation by returning the new page URL from the response104### Query a Database105Filter and sort database entries.1061. Use http tool:107 ```108 http POST https://api.notion.com/v1/databases/{database_id}/query109 Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28, Content-Type: application/json110 Body: {111 "filter": {112 "and": [113 {"property": "Status", "select": {"equals": "In Progress"}},114 {"property": "Priority", "select": {"equals": "High"}}115 ]116 },117 "sorts": [118 {"property": "Due Date", "direction": "ascending"}119 ],120 "page_size": 50121 }122 ```1232. Handle pagination: if `has_more` is true, re-query with `"start_cursor": "{next_cursor}"`1243. Parse property values by type: title, rich_text, select, multi_select, date, number, checkbox, url, etc.1254. Present results as a formatted list or table126### Append Content to Existing Page127Add new blocks to the end of a page.1281. Use http tool:129 ```130 http PATCH https://api.notion.com/v1/blocks/{page_id}/children131 Headers: Authorization: Bearer {token}, Notion-Version: 2022-06-28, Content-Type: application/json132 Body: {133 "children": [134 {135 "object": "block",136 "type": "paragraph",137 "paragraph": {138 "rich_text": [{"type": "text", "text": {"content": "Appended content."}}]139 }140 }141 ]142 }143 ```144## Guidelines145- Always confirm before creating or modifying pages146- When searching, try multiple query terms if the first search returns no results147- Database property names are case-sensitive — match them exactly148- Page IDs can be extracted from Notion URLs: `notion.so/Page-Title-{32_char_hex_id}`149- Strip hyphens from URL-style IDs before using in API calls150- Rich text content has a 2000 character limit per block — split long content into multiple blocks151- If the token is missing or invalid, guide the user to Settings to configure it