fix(notion): align integration with live API docs, add block retrieval coverage#5491
Conversation
…l coverage
- wire up notion_update_page in the block (was registered but unreachable — no dropdown option or subBlocks)
- fix legacy NotionBlock outputs to cover all 17 operations, not just content/metadata
- trim ID params (pageId, databaseId, parentId) before use in request URLs across 8 tool files
- remove content required:true on create_page (Notion allows title-only pages)
- remove dead unused NotionReadDatabaseParams interface
- add notion_retrieve_block/_v2 tool for GET /v1/blocks/{id}, filling a gap in block CRUD coverage
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview New and exposed capabilities: Adds Reliability and UX fixes: Notion IDs used in request URLs are Cleanup: Removes dead/unused type helpers in Reviewed by Cursor Bugbot for commit 040d6e7. Configure here. |
Greptile SummaryThis PR closes a set of alignment gaps between the Notion integration's UI, tool registry, and live API docs:
Confidence Score: 5/5Safe to merge — changes are additive fixes to the Notion integration with no breaking API surface changes. All changes are additive: new tools, new output conditions, and whitespace guards. The legacy block and V2 block are both correctly wired, the tool registry is updated, and the V2 versioned-selector pattern is followed consistently. The only finding is a documentation inaccuracy in the newly added docs section that does not affect runtime behavior. apps/docs/content/docs/en/integrations/notion.mdx — the notion_retrieve_block output table lists all shared outputs rather than just what the tool returns. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User selects operation in Notion Block] --> B{Block version?}
B -- Legacy NotionBlock --> C[getTool switch → notion_retrieve_block]
B -- NotionV2Block --> D[createVersionedToolSelector\n operation + '_v2'\n → notion_retrieve_block_v2]
C --> E[notionRetrieveBlockTool\nGET /v1/blocks/blockId.trim]
D --> F[notionRetrieveBlockV2Tool\nshares request + transformResponse]
E --> G[transformResponse\nsuccess: response.ok\noutput: id, type, has_children,\narchived, block]
F --> G
G --> H[Block outputs conditioned on\n'notion_retrieve_block'\nid · type · has_children\narchived · block]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[User selects operation in Notion Block] --> B{Block version?}
B -- Legacy NotionBlock --> C[getTool switch → notion_retrieve_block]
B -- NotionV2Block --> D[createVersionedToolSelector\n operation + '_v2'\n → notion_retrieve_block_v2]
C --> E[notionRetrieveBlockTool\nGET /v1/blocks/blockId.trim]
D --> F[notionRetrieveBlockV2Tool\nshares request + transformResponse]
E --> G[transformResponse\nsuccess: response.ok\noutput: id, type, has_children,\narchived, block]
F --> G
G --> H[Block outputs conditioned on\n'notion_retrieve_block'\nid · type · has_children\narchived · block]
Reviews (4): Last reviewed commit: "fix(notion): document type-specific cont..." | Re-trigger Greptile |
…s, dead types, regen docs - add missing startCursor/start_cursor pagination param to notion_query_database and notion_search - fix notion_search missing from the shared pageSize/startCursor field's operation condition in NotionBlock - fix NotionV2Block title/url/created_time/last_edited_time outputs rendering unconditionally for every operation instead of only the ones that return them - remove 153 lines of dead unused output-shape constants from types.ts - regenerate integration docs
type/block/archived only conditioned on notion_update_block/notion_delete_block, and has_children was missing entirely — Retrieve Block's payload was invisible in the legacy NotionBlock output picker (Greptile P1 on PR #5491).
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 98cc1ef. Configure here.
block.properties (BLOCK_OUTPUT_PROPERTIES) only covers common block fields, not the type-specific sub-object (paragraph.rich_text, image.file, etc.) — that varies per block type and isn't enumerable. Documented in the description per Greptile P2 on PR #5491; no functional change, block: data already carries the full object at runtime.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 040d6e7. Configure here.
Summary
notion_update_pagebeing registered and wired intools.access/tools.config.toolbut completely unreachable in the UI — no dropdown option or subBlocks existed for itNotionBlockoutputs only declaringcontent/metadata, leaving 9 of 17 operations (add row, append/retrieve/update/delete block, comments, users) with no matching outputs.trim()on ID params (pageId,databaseId,parentId) used directly in request URLs across 8 tool files to guard against copy-paste whitespacerequired: trueoncontentfornotion_create_page— Notion allows title-only page creationNotionReadDatabaseParamsinterface shadowed by the real one inread_database.tsnotion_retrieve_block/notion_retrieve_block_v2(GET /v1/blocks/{id}) — we had update/delete/append/retrieve-children for blocks but no way to fetch a single block's content directlyscopes: []is correct and unchangedType of Change
Testing
Tested manually — validated every tool against live Notion API docs, ran full validate-integration checklist (tool params, block↔tool alignment, conditions, outputs, OAuth scopes).
Checklist