Update wiki page
update_wiki_pageEdit a wiki page: retitle it, change its body, move it under another parent (or to the top of its space), or set its labels. Identify it by 'id', or by 'spaceKey' + 'title'. To change part of the body, pass 'edits' (exact find-and-replace on the Markdown source, each 'oldText' occurring exactly once) or 'replaceSection' — the answer says where each landed, not the page, so a one-line fix to a long page costs one line. Or pass 'operations' — insert, replace, delete or move a block, set a table cell, add or drop a row, set a formula, rename a term, tick a checklist item, retitle — addressed by names that survive other people's edits (a claim's label, an {anchor:…}, a \label, a heading's anchor, a table row by its first cell and a column by its header), with 'baseVersion' the version you read: what others wrote since is merged with yours block by block, and the answer says per operation 'applied', 'merged', 'conflict' or 'gone'. All or nothing unless partial: true. 'markdown' replaces the whole body — read it first with get_wiki_page(withMarkdown: true) and edit that, or the page's links, images and macros are dropped; 'appendMarkdown' adds to the end and leaves what is there untouched. Mention someone as @Their Name, the wiki's own form. Requires permission to edit the page. A page with ```anim blocks answers 'anims': per block, whether it plays or every problem with where it stands. Answers with 'notified' (who this actually reaches) and 'unresolvedMentions' (what looked like a mention and reached nobody, each with a reason) — a wrong handle is stored as written and never refused, so that list is the only sign it did not land.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "update_wiki_page"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Page id (as returned by search_wiki). | |
| edits | No | Exact replacements in the page's Markdown source — the text get_wiki_page returns with 'section', 'offset' or withMarkdown: true. Every 'oldText' is matched against the page as you read it (not against the result of the other edits) and must occur exactly once unless 'replaceAll' is set; if any edit does not fit, none is applied. Pair with 'expectedVersion'. | |
| title | No | Current page title, when identifying the page by title. | |
| labels | No | Labels to set, space or comma separated. Replaces the existing set. Stored in lower case, except a label starting with '$', which is kept exactly as written; list_wiki_labels shows the ones the space already uses. | |
| message | No | Short note for the page history, e.g. why you changed it. | |
| partial | No | With baseVersion or operations: on a conflict, or an operation that is 'gone', write everything else anyway as one version; the answer still lists what was left out. Default false: all or nothing. | |
| markdown | No | The complete new body as Markdown — replaces what is there. Carries $…$ / $$…$$ LaTeX formulas and the wiki's macros on a line of their own ({toc}, {children}, {info} … {info}, {expand:title=…} … {expand}). A theorem, lemma, proposition, corollary, conjecture or question is a block of its own — ::: theorem {#thm:label status=computer number=5.8 title="…"} on its line, the statement, then ::: — read into the project's register of claims at the save (list_claims); 'claims' in the answer says which. | |
| newTitle | No | New title. The page's existing links follow the rename. | |
| parentId | No | Move the page under this parent page id. | |
| spaceKey | No | Space key, when identifying the page by title. | |
| minorEdit | No | Mark this as a minor edit in the history. | |
| operations | No | Changes to the body addressed by what survives an edit, applied on 'baseVersion' (default: the version now) and merged with whatever was written since. Each is {op, …}: insert_block {markdown, after|before: <block> | startOf|endOf: <section>; none of them: the end of the body}; replace_block {target: <block>, markdown}; delete_block {target}; move_block {target, after|before|startOf|endOf}; replace_section {section, markdown — heading line included; "" removes it}; replace_text {oldText, newText, replaceAll?, target?: <block> | section?} — exactly once in that scope (default the whole body); set_cell {table?, row|rowIndex, column|columnIndex, value}; insert_row {table?, row|rowIndex (after it; rowIndex 0: first; neither: last), cells[]}; delete_row {table?, row|rowIndex} — 'row' is the row's FIRST cell, 'column' a header, indexes from 1, 'table' left out when the body has one; set_formula {target: a $$ block, or anchor 'label:<\label>' for a formula anywhere, tex}; rename_term {from, to, section?} — whole words only, never inside code, formulas, links, mentions or macros, one block at a time; set_checklist_item {item: id or words, checked}; set_title {title} (pages). A <block> is {anchor} — a claim's label, an {anchor:…} name, a \label, a heading's anchor, or a full key 'claim:…', 'anchor:…', 'label:…', 'h:…', 'check:…' — or {quote: ≥8 characters found in exactly one block}, or {section, index} (1: the first block under the heading, 0: the heading) or {index} alone (the body's n-th block). Optional 'expect' on any operation but rename_term: the target's text as you read it — if it reads otherwise on that version the operation is 'gone'. The answer's 'operations' says per operation 'applied', 'merged' (somebody else changed that block too and both stand), 'conflict' (both changed one word, cell, formula or atomic block — see 'conflicts', each with base, mine and current text) or 'gone' (its address is not on that version, or 'expect' differs). ALL OR NOTHING: one conflict or one gone operation writes nothing — unless partial: true, which writes the rest as one version. Two operations that change the same text, or one that cannot be read, refuse the call. | |
| toTopLevel | No | Move the page to the top of its space, out from under any parent, so it sits beside the space's other root pages. Use this instead of parentId/parentTitle — a tool argument has no way to say 'no parent' by leaving one out. | |
| baseVersion | No | The version you read (get_wiki_page's 'version') and wrote your change on. Unlike 'expectedVersion', an edit somebody made since is MERGED with yours, block by block, when the two touch different paragraphs, list items, table cells or words; where both changed one place nothing of the call is written and 'conflicts' lists each place (base, mine, current) — unless partial: true. Works with 'operations', 'edits', 'replaceSection', 'newTitle' and a whole 'markdown'. Not with 'expectedVersion'. | |
| parentTitle | No | Move the page under the page with this title, in the same space. | |
| appendMarkdown | No | Markdown to add to the end of the page, leaving the rest as it is. Same syntax as 'markdown'. | |
| replaceSection | No | Replace one whole section: 'section' names it as get_wiki_page's 'section' does (anchor or heading text), 'markdown' is what replaces it — heading line included, as reading the section returned it. Can be combined with 'edits' elsewhere on the page. | |
| expectedVersion | No | The version you read (from get_wiki_page). If the page has moved on since, the edit is refused instead of overwriting someone else's. 'baseVersion' instead merges with what was written since. |