Skill: Notion Page Content Updater
Purpose
Update a specified Notion page with structured content extracted from a source document (e.g., Word, PDF, text). This skill automates the end-to-end process of finding the page, reading the document, parsing its content, and updating the Notion page's blocks accordingly.
Core Workflow
Follow these steps precisely:
- •Clarify Request & Identify Target: Confirm the exact name of the Notion page to update and the path/filename of the source document.
- •Locate the Notion Page:
- •Use
notion-API-post-searchwith the exact page name. If no results, search more broadly (e.g., partial name) or use an empty query{}to list all pages/databases. - •From the search results, identify the correct page by its
titleproperty. Note itsid.
- •Use
- •Extract Source Content:
- •Use the appropriate tool (
word-get_document_text,pdf-get_document_text,filesystem-read_file) to read the source document's full text.
- •Use the appropriate tool (
- •Analyze Page Structure & Plan Updates:
- •Retrieve the current page structure using
notion-API-get-block-childrenwith the page ID. - •Analyze the returned blocks to identify the target sections (e.g., headings for "About Me", "Paintings"). Note the block IDs that come immediately before where new content should be inserted.
- •Parse the extracted document text to identify the relevant content for each target section.
- •Retrieve the current page structure using
- •Execute Page Updates (Section by Section):
- •For placeholder content: If a section contains placeholder text (e.g.,
[Birth, Your education...]), delete the old block usingnotion-API-delete-a-block. - •To add new content after a heading/block: Use
notion-API-patch-block-children. Specify the page ID asblock_id, use theafterparameter with the ID of the heading block, and provide the new content in thechildrenarray. - •Structure the content appropriately: Use
paragraphblocks for descriptive text andbulleted_list_itemblocks for lists. - •Process one major section at a time (e.g., About Me, then Paintings, then Workshop, etc.).
- •For placeholder content: If a section contains placeholder text (e.g.,
- •Verify & Conclude: After all updates, retrieve the page children again to confirm the changes. Provide a clear summary of what was updated.
Critical Implementation Notes
- •Block Update Limitation: The
notion-API-update-a-blockendpoint has very limited functionality and often cannot be used to change a block's type or rich text content. The primary method for adding content ispatch-block-children. - •Content Chunking: Notion API calls have size limits. Break long document text into logical paragraphs when creating
childrenarrays. - •Special Characters: Escape quotation marks and newlines (
\n) properly in JSON payloads for block content. - •Error Handling: If a search finds multiple pages with similar names, ask the user for clarification. If a section heading doesn't exist on the target page, you may need to create it first.
Required Tools
- •
notion-API-post-search - •
notion-API-get-block-children - •
notion-API-patch-block-children - •
notion-API-delete-a-block - •
word-get_document_text/pdf-get_document_text/filesystem-read_file - •
local-claim_done
Example Trajectory Pattern
The provided trajectory is a canonical example. Follow its pattern: search, extract, analyze structure, then sequentially update sections using patch-block-children after relevant headings.