Notion plugin: chunk long paragraph text and batch oversized page writes
The community Notion plugin currently sends paragraph text and child blocks without respecting Notion's request limits.
At commit 9ff63a6, tool_create_page (lines 606–617) and tool_append_content (lines 732–745) put each complete nonblank line into a single rich_text[].text.content object, then send all paragraphs in one request. Notion's documented limits are 2,000 characters per text object and 100 elements per array.
An offline fixture executing the two production handler functions with a captured API boundary confirms eight boundary cases: for each handler, a 2,000-character paragraph and 100 short paragraphs stay within these limits, while 2,001 characters and 101 paragraphs exceed them. Each case emits one request. This verifies the generated payload, not a live Notion rejection; no live Notion workspace was used.
Proposed small scope:
- Share paragraph construction that preserves text/order while splitting rich-text content into supported sizes.
- Bound rich-text arrays and send ordered child batches for create and append, also respecting the overall serialized request-size limit.
- Report partial completion accurately if a later batch fails; do not claim full success or blindly replay already-written content.
- Add hermetic regression tests for both handlers at the text/child boundaries, text reconstruction and order, multibyte payload sizing, and later-batch failure. Run the repository's applicable preflight/PR checks.
This is separate from #5124/#5130 and #7808, which address reporting MCP tool errors, not construction of these plugin payloads. I did not find an existing issue or PR for this exact chunking/batching scope in the Notion-related all-state search.
Is this plugin still supported, and would you approve this scoped fix as a small paid bounty under the contribution guide? Please confirm the reward and acceptance criteria before implementation. No bounty amount or award is assumed.
I've submitted the AI-assisted implementation in #13335, with 17 passing hermetic production-handler tests, local preflight checks, and independent review. It handles bounded text and request batches, preserves content order, and reports confirmed progress without replaying uncertain writes. Credit for the original report, reproduction, and scope goes to @kaijakagi-sys.
Following the contribution guide, @josancamon19, would you consider a $25 PayPal bounty for this implementation if accepted and merged? Eligibility and any reward allocation are entirely your decision; no award is assumed. Payment details would be coordinated privately.