Skip to main content
Glama

Update wiki page

update_wiki_page
Destructive

Edit 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

NameRequiredDescriptionDefault
idNoPage id (as returned by search_wiki).
editsNoExact 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'.
titleNoCurrent page title, when identifying the page by title.
labelsNoLabels 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.
messageNoShort note for the page history, e.g. why you changed it.
partialNoWith 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.
markdownNoThe 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.
newTitleNoNew title. The page's existing links follow the rename.
parentIdNoMove the page under this parent page id.
spaceKeyNoSpace key, when identifying the page by title.
minorEditNoMark this as a minor edit in the history.
operationsNoChanges 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.
toTopLevelNoMove 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.
baseVersionNoThe 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'.
parentTitleNoMove the page under the page with this title, in the same space.
appendMarkdownNoMarkdown to add to the end of the page, leaving the rest as it is. Same syntax as 'markdown'.
replaceSectionNoReplace 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.
expectedVersionNoThe 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / baseVersion
      Added value: +{
      +  "default": null,
      +  "description": "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'.",
      +  "type": [
      +    "integer",
      +    "null"
      +  ]
      +}
    • changedInput schema / properties / expectedVersion / description
      Previous value: -"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."New value: +"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."
    • addedInput schema / properties / operations
      Added value: +{
      +  "default": null,
      +  "description": "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.",
      +  "items": {
      +    "properties": {
      +      "after": {
      +        "description": "insert_block / move_block: put it right after this block.",
      +        "properties": {
      +          "anchor": {
      +            "description": "A name the text gives the block: a claim's label ('thm:main', from ::: theorem {#thm:main}), an {anchor:name} line's name (the block under it), a formula's \\label{…}, a heading's anchor, or a checklist item's id. The full keys get_wiki_page's outline uses — 'claim:thm:main', 'anchor:fig1', 'label:eq:energy', 'h:results', 'check:3fa2…' — are taken as they are.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "index": {
      +            "description": "The block's place: 1 is the first block after the section's heading (0 the heading itself), or without 'section' the first block of the body. Blocks are paragraphs, list items (each one), tables, formulas, code fences, claims, headings.",
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "quote": {
      +            "description": "Words quoted from the block, at least 8 characters, found in exactly one block (spaces and line breaks compared as one space).",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "section": {
      +            "description": "With 'index': the section (its anchor or heading text, as get_wiki_page's 'section') whose blocks are counted. Alone, on 'table' or a set_formula target: the one table (formula) in that section.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      },
      +      "before": {
      +        "description": "insert_block / move_block: put it right before this block.",
      +        "properties": {
      +          "anchor": {
      +            "description": "A name the text gives the block: a claim's label ('thm:main', from ::: theorem {#thm:main}), an {anchor:name} line's name (the block under it), a formula's \\label{…}, a heading's anchor, or a checklist item's id. The full keys get_wiki_page's outline uses — 'claim:thm:main', 'anchor:fig1', 'label:eq:energy', 'h:results', 'check:3fa2…' — are taken as they are.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "index": {
      +            "description": "The block's place: 1 is the first block after the section's heading (0 the heading itself), or without 'section' the first block of the body. Blocks are paragraphs, list items (each one), tables, formulas, code fences, claims, headings.",
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "quote": {
      +            "description": "Words quoted from the block, at least 8 characters, found in exactly one block (spaces and line breaks compared as one space).",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "section": {
      +            "description": "With 'index': the section (its anchor or heading text, as get_wiki_page's 'section') whose blocks are counted. Alone, on 'table' or a set_formula target: the one table (formula) in that section.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      },
      +      "cells": {
      +        "description": "insert_row: the new row's cells, as many as the table has columns.",
      +        "items": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "type": [
      +          "array",
      +          "null"
      +        ]
      +      },
      +      "checked": {
      +        "description": "set_checklist_item: true ticks the box, false clears it.",
      +        "type": [
      +          "boolean",
      +          "null"
      +        ]
      +      },
      +      "column": {
      +        "description": "set_cell: the column whose header reads this.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "columnIndex": {
      +        "description": "Instead of 'column': the column's number, from 1.",
      +        "type": [
      +          "integer",
      +          "null"
      +        ]
      +      },
      +      "endOf": {
      +        "description": "insert_block / move_block: put it last in this section, after its subsections (anchor or heading text). With none of after/before/startOf/endOf, insert_block appends to the end of the body.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "expect": {
      +        "description": "Optional, every operation but rename_term: the target's text as you read it (or the SHA-256 hex of it with runs of spaces made one, ends trimmed). If the version you name reads otherwise there, the operation is 'gone' rather than applied to something you did not see.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "from": {
      +        "description": "rename_term: the word or phrase to rename, matched as a whole word, exactly as written (case included).",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "item": {
      +        "description": "set_checklist_item: the item — its id (get_checklist's, or 'check:…') or its words.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "markdown": {
      +        "description": "insert_block, replace_block: the Markdown of the block(s). replace_section: the section with its heading line; an empty string removes the section.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "newText": {
      +        "description": "replace_text: what to put in its place (an empty string deletes).",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "oldText": {
      +        "description": "replace_text: the exact text to replace, as the source has it; it must occur exactly once in the scope unless replaceAll.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "op": {
      +        "description": "What to do: insert_block, replace_block, delete_block, move_block, replace_section, replace_text, set_cell, insert_row, delete_row, set_formula, rename_term, set_checklist_item, set_title.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "replaceAll": {
      +        "description": "replace_text: replace every occurrence in the scope.",
      +        "type": "boolean"
      +      },
      +      "row": {
      +        "description": "set_cell, delete_row: the row whose FIRST cell reads this. insert_row: the new row goes after it.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "rowIndex": {
      +        "description": "Instead of 'row': the row's number, 1 being the first row under the header. insert_row: 0 puts the new row first; leave both out to add it last.",
      +        "type": [
      +          "integer",
      +          "null"
      +        ]
      +      },
      +      "section": {
      +        "description": "replace_section: the section (anchor or heading text). replace_text, rename_term: limit the operation to this section.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "startOf": {
      +        "description": "insert_block / move_block: put it first in this section, right under its heading (anchor or heading text).",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "table": {
      +        "description": "set_cell, insert_row, delete_row: the table. Leave it out when the body has one table; a 'section' alone means the one table in that section.",
      +        "properties": {
      +          "anchor": {
      +            "description": "A name the text gives the block: a claim's label ('thm:main', from ::: theorem {#thm:main}), an {anchor:name} line's name (the block under it), a formula's \\label{…}, a heading's anchor, or a checklist item's id. The full keys get_wiki_page's outline uses — 'claim:thm:main', 'anchor:fig1', 'label:eq:energy', 'h:results', 'check:3fa2…' — are taken as they are.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "index": {
      +            "description": "The block's place: 1 is the first block after the section's heading (0 the heading itself), or without 'section' the first block of the body. Blocks are paragraphs, list items (each one), tables, formulas, code fences, claims, headings.",
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "quote": {
      +            "description": "Words quoted from the block, at least 8 characters, found in exactly one block (spaces and line breaks compared as one space).",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "section": {
      +            "description": "With 'index': the section (its anchor or heading text, as get_wiki_page's 'section') whose blocks are counted. Alone, on 'table' or a set_formula target: the one table (formula) in that section.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      },
      +      "target": {
      +        "description": "The block the operation acts on (replace_block, delete_block, move_block, set_formula; replace_text's scope).",
      +        "properties": {
      +          "anchor": {
      +            "description": "A name the text gives the block: a claim's label ('thm:main', from ::: theorem {#thm:main}), an {anchor:name} line's name (the block under it), a formula's \\label{…}, a heading's anchor, or a checklist item's id. The full keys get_wiki_page's outline uses — 'claim:thm:main', 'anchor:fig1', 'label:eq:energy', 'h:results', 'check:3fa2…' — are taken as they are.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "index": {
      +            "description": "The block's place: 1 is the first block after the section's heading (0 the heading itself), or without 'section' the first block of the body. Blocks are paragraphs, list items (each one), tables, formulas, code fences, claims, headings.",
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "quote": {
      +            "description": "Words quoted from the block, at least 8 characters, found in exactly one block (spaces and line breaks compared as one space).",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "section": {
      +            "description": "With 'index': the section (its anchor or heading text, as get_wiki_page's 'section') whose blocks are counted. Alone, on 'table' or a set_formula target: the one table (formula) in that section.",
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      },
      +      "tex": {
      +        "description": "set_formula: the new TeX, without the $ or $$ around it.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "title": {
      +        "description": "set_title: the page's new title (merged as a field). Wiki pages only.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "to": {
      +        "description": "rename_term: what it becomes.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "value": {
      +        "description": "set_cell: the cell's new text, one line. A '|' must be written \\| unless it is inside $…$ or `code`.",
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      }
      +    },
      +    "type": [
      +      "object",
      +      "null"
      +    ]
      +  },
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / partial
      Added value: +{
      +  "default": false,
      +  "description": "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.",
      +  "type": "boolean"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / markdown / description
      Previous value: -"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})."New value: +"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."
  3. Changed1 schema field changed
    • changedInput schema / properties / labels / description
      Previous value: -"Labels to set, space or comma separated. Replaces the existing set."New value: +"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."
  4. First observed

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnlyHint=false and destructiveHint=true; the description goes far beyond by disclosing merge semantics ('baseVersion' merges block by block; 'expectedVersion' refuses), the all-or-nothing default and the partial escape hatch, the per-operation result vocabulary (applied/merged/conflict/gone), and the 'gone' guard via 'expect'. It also warns that a bad mention handle is silently stored and only surfaces in 'unresolvedMentions', which is a non-obvious behavioral trap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening clause is well front-loaded, but the body is a single dense paragraph with long em-dash chains that restate merge and per-operation-result semantics already spelled out in the 'operations' schema description. Much of it earns its place, but the absence of structure makes it hard to scan and produces real duplication.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 18-parameter mutation tool with no output schema, the description covers identity, mode selection, concurrency model, permission requirements, mention syntax, and even the shape of the response ('notified', 'unresolvedMentions', 'anims', 'operations', 'claims'). Nothing an agent needs in order to call it safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already carries per-parameter documentation and the baseline would be 3. The description earns extra credit by adding cross-parameter meaning the schema does not: the baseVersion-vs-expectedVersion tradeoff, why toTopLevel exists instead of omitting parentId, and which modes combine (edits + replaceSection).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names the verb (edit) and the resource (a wiki page) and enumerates the concrete capabilities: retitle, change body, move parent, set labels. It also states the two identification schemes ('id' or 'spaceKey' + 'title'), which distinguishes it cleanly from get_wiki_page, create_wiki_page and delete_wiki_page.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes between the four editing modes: 'edits' for exact find-and-replace, 'replaceSection' for a whole section, 'operations' for structural/anchored edits, and 'markdown'/'appendMarkdown' for whole-body writes, including the precondition 'read it first with get_wiki_page(withMarkdown: true)'. It also warns against the alternatives' consequences (dropping links, images and macros) and states the permission prerequisite.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources