update_page
Modify existing wiki page content on Wizzypedia by providing new text and an optional edit summary.
Instructions
Update an existing wiki page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the page to update | |
| content | Yes | New wiki content for the page | |
| summary | No | Edit summary | Updated via MCP |
Implementation Reference
- index.ts:744-774 (handler)MCP tool handler for 'update_page': extracts parameters from tool call arguments, invokes wikiClient.updatePage, and returns structured JSON response with edit result.case "update_page": { const { title, content, summary = "Updated via MCP" } = request.params.arguments as { title: string; content: string; summary?: string; }; const result = await wikiClient.updatePage(title, content, summary); return { content: [ { type: "text", text: JSON.stringify( { title, result: result.edit.result, newRevId: result.edit.newrevid, success: result.edit.result === "Success" }, null, 2 ) } ] }; }
- index.ts:421-439 (helper)MediaWikiClient method that performs the actual MediaWiki API 'edit' action to update page content, handling edit token acquisition.async updatePage( title: string, content: string, summary: string = "" ): Promise<any> { // Ensure we have an edit token const token = await this.getEditToken(); return this.makeApiCall( { action: "edit", title, text: content, summary, token }, "POST" ); }
- index.ts:525-547 (schema)Tool schema definition specifying input parameters (title, content, optional summary) for the update_page tool.const UPDATE_PAGE_TOOL: Tool = { name: "update_page", description: "Update an existing wiki page", inputSchema: { type: "object", properties: { title: { type: "string", description: "Title of the page to update" }, content: { type: "string", description: "New wiki content for the page" }, summary: { type: "string", description: "Edit summary", default: "Updated via MCP" } }, required: ["title", "content"] } };
- index.ts:598-607 (registration)Registration of all tools including UPDATE_PAGE_TOOL in the ListTools handler, making the tool discoverable by MCP clients.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ SEARCH_PAGES_TOOL, READ_PAGE_TOOL, CREATE_PAGE_TOOL, UPDATE_PAGE_TOOL, GET_PAGE_HISTORY_TOOL, GET_CATEGORIES_TOOL ] }));