get_page_history
Retrieve revision history for Wizzypedia pages to track changes, view edit details, and monitor content evolution over time.
Instructions
Get revision history of a page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the page | |
| limit | No | Maximum number of revisions to return (default: 10) |
Implementation Reference
- index.ts:776-827 (handler)MCP tool handler case for 'get_page_history': extracts title and limit from arguments, calls wikiClient.getPageHistory(), handles missing page, formats revisions list into JSON response.case "get_page_history": { const { title, limit = 10 } = request.params.arguments as { title: string; limit?: number; }; const result = await wikiClient.getPageHistory(title, limit); const pages = result.query.pages; const page = pages[0]; if (page.missing) { return { content: [ { type: "text", text: JSON.stringify( { title: page.title, exists: false, message: "Page does not exist" }, null, 2 ) } ] }; } const revisions = page.revisions.map((rev: any) => ({ id: rev.revid, timestamp: rev.timestamp, user: rev.user, comment: rev.comment })); return { content: [ { type: "text", text: JSON.stringify( { title: page.title, revisions }, null, 2 ) } ] }; }
- index.ts:441-449 (helper)MediaWikiClient.getPageHistory(): core implementation that makes the MediaWiki API query for page revisions with specified props and limit.async getPageHistory(title: string, limit: number = 10): Promise<any> { return this.makeApiCall({ action: "query", prop: "revisions", titles: title, rvprop: "timestamp|user|comment|ids", rvlimit: limit }); }
- index.ts:549-567 (schema)Tool schema definition: specifies inputSchema with title (required string) and optional limit (number, default 10).const GET_PAGE_HISTORY_TOOL: Tool = { name: "get_page_history", description: "Get revision history of a page", inputSchema: { type: "object", properties: { title: { type: "string", description: "Title of the page" }, limit: { type: "number", description: "Maximum number of revisions to return (default: 10)", default: 10 } }, required: ["title"] } };
- index.ts:598-607 (registration)Tool registration: GET_PAGE_HISTORY_TOOL is included in the tools list returned by ListToolsRequestSchema handler.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ SEARCH_PAGES_TOOL, READ_PAGE_TOOL, CREATE_PAGE_TOOL, UPDATE_PAGE_TOOL, GET_PAGE_HISTORY_TOOL, GET_CATEGORIES_TOOL ] }));