Update Page Content
update_page_contentReplace, append, or prepend Markdown content in a Docmost page body via collaboration WebSocket, persisting changes even when the REST API cannot.
Instructions
Writes into the body of an already-created page.
Docmost's REST API cannot do this — the body lives in the Yjs collaboration server — so this tool opens the collaboration WebSocket, edits the document and waits for it to be persisted (~13 s).
Unlike /pages/update, which accepts an operation field and ignores it,
mode genuinely works here:
"replace"(default): the page ends up with exactly this Markdown."append": keeps what is there and adds this at the end."prepend": keeps what is there and adds this at the start.
The Markdown is converted with Docmost's own converter, so it supports its whole schema: headings, bold, italics, code, lists, tables, blockquotes, code blocks, etc.
Requires the yjs extra (uv sync --extra yjs).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"page_id": "<page_id>",
"markdown": "<markdown>"
},
"name": "update_page_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | `"replace"`, `"append"` or `"prepend"`. | replace |
| page_id | Yes | UUID or slugId of the page to edit. | |
| markdown | Yes | Content to write, in Markdown. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||