mediawiki_edit_page
Create new wiki pages or replace entire page content, with optional section edits and previews to prevent edit conflicts.
Instructions
Create new pages or rewrite entire page content.
USE WHEN: User says "create a new page", "rewrite the entire About page", "replace all content".
NOT FOR: Simple text changes (use mediawiki_find_replace). Not for formatting (use mediawiki_apply_formatting).
PARAMETERS:
title: Page name (required)
content: New page content (required)
section: Edit specific section only (optional)
summary: Edit summary (required for good practice)
minor: Mark as minor edit (default false)
bot: Mark as bot edit (default false)
base_timestamp: Revision timestamp from mediawiki_get_page (optional, recommended). When set, the edit fails with 'editconflict' if someone else changed the page since that revision, instead of silently overwriting their edit. On conflict: re-read with mediawiki_get_page and reapply.
preview: Preview changes without saving. Omit to preview (default true, for safety): the current revision is fetched, a line diff of what would change is returned, and nothing is written and no token is consumed. Set preview=false to apply the edit.
RETURNS: Preview (default): per-line diff of the planned content against the current revision ('changes' entries: before=removed line, after=added line, a modified line appears as its removal followed by its addition), plus new_page=true when the edit would create the page. With preview=false: revision ID, diff URL, and undo instructions.
NOTE: Requires authentication (bot password) to apply changes. Anonymous sessions cannot edit.
WARNING: This overwrites entire page content unless section is specified. Preview first (omit preview) before applying.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bot | No | Mark as bot edit (requires bot flag) | |
| minor | No | Mark as minor edit | |
| title | Yes | Page title to edit or create | |
| content | Yes | New page content in wikitext format | |
| preview | No | Preview changes without saving. Omitted means preview (the safe default): the edit is not saved, no token is consumed, and a line diff against the current revision is returned. Set false to apply the edit. | |
| section | No | Section to edit ('new' for new section, number for existing) | |
| summary | No | Edit summary explaining the change | |
| rationale | Yes | Required one-sentence explanation of why you are making this change. Stored in the audit log for post-hoc intent reconstruction. | |
| captcha_id | No | CAPTCHA ID from a previous failed attempt, required when answering a CAPTCHA | |
| captcha_word | No | User-provided answer to the CAPTCHA challenge | |
| base_timestamp | No | Timestamp of the revision this edit is based on (from get_page). When set, the wiki rejects the edit with an editconflict error if someone else edited the page in the meantime, instead of silently overwriting their change |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | ||
| changes | No | ||
| message | Yes | ||
| page_id | Yes | ||
| preview | Yes | ||
| success | Yes | ||
| new_page | Yes | ||
| page_url | No | ||
| captcha_id | No | ||
| revision_id | Yes | ||
| captcha_type | No | ||
| captcha_question | No |