Replace Section
replace_sectionReplace a specific page section by index using a section hash to prevent overwriting changes, with an optional dry-run diff and automatic snapshot before writing.
Instructions
Replace one section of a page, found with get_page_outline and read with get_section. Pass the section_hash from get_section: if the section changed since, nothing is written. By default the heading is kept and content replaces what is under it, subsections included; with keep_heading=false content replaces the heading too, and an empty content removes the section. The whole body is saved as a snapshot first. The whole body is rewritten from Markdown, so this is refused on pages with formatting Markdown cannot hold, as update_page replace is.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | Yes | Page id, slug id or Docmost page URL. | |
| index | Yes | Section index from get_page_outline. | |
| content | Yes | New Markdown for the section. | |
| dry_run | No | Only show the change as a diff; write nothing. | |
| keep_heading | No | Keep the section's heading line. | |
| section_hash | Yes | section_hash from get_section. | |
| drop_formatting | No | Write even though the page has formatting Markdown cannot hold, which is then removed. Prefer replace_page_json for such pages. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||