Skip to content

Bug: notion-update-page escapes user mentions when updating content #143

@mpiroc

Description

@mpiroc

Bug Description

The notion-update-page tool improperly escapes user mentions (<mention-user> tags) when updating page content. User mentions that exist in the original content are converted to escaped strings like \\{\\{user://...\\}\\} instead of preserving the proper <mention-user url="{{user://...}}"/> format.

Steps to Reproduce

  1. Create or identify a Notion page with action items containing user mentions (e.g., <mention-user url="{{user://1f9d872b-594c-81cc-8948-0002e98318dd}}"/>)
  2. Use the notion-fetch tool to read the page - confirms mentions display correctly as <mention-user> tags
  3. Use the notion-update-page tool with replace_content_range command to update a section containing user mentions
  4. Fetch the page again with notion-fetch to observe the result

Expected Behavior

User mentions should be preserved in their original format (<mention-user url="{{user://...}}"/>) and display correctly as user mentions in the Notion UI.

Actual Behavior

After updating, user mentions are escaped and appear as:

  • \\{\\{user://1f9d872b-594c-81cc-8948-0002e98318dd\\}\\} in the fetched content
  • Plain text in the Notion UI instead of clickable user mentions

Investigation & Additional Context

  • The issue occurs even when the new content string includes properly formatted <mention-user> tags
  • Multiple consecutive updates compound the escaping (e.g., {{{{https://...}}}})
  • The notion-fetch tool correctly reads and displays <mention-user> tags from original content
  • Only notion-update-page causes the escaping - suggests the issue is in how the update tool processes or serializes the content before sending to the Notion API
  • This makes it impossible to programmatically update pages with action items or task lists that have user assignments without breaking the user mentions

Example

Original content (from notion-fetch):

- [ ] <mention-user url="{{user://1f9d872b-594c-81cc-8948-0002e98318dd}}"/> We need a story for table-body-skeleton

After using notion-update-page (from subsequent notion-fetch):

- [ ] \\{\\{user://1f9d872b-594c-81cc-8948-0002e98318dd\\}\\} We need a story for table-body-skeleton

Environment

  • MCP Server: notion-mcp-server (official)
  • Client: Claude Code
  • Notion API version: Latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions