Skip to main content
Glama
cryppadotta
by cryppadotta

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
NameRequiredDescriptionDefault
titleYesTitle of the page
limitNoMaximum number of revisions to return (default: 10)

Implementation Reference

  • 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
            )
          }
        ]
      };
    }
  • 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
      });
    }
  • 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
      ]
    }));

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cryppadotta/mcp-wizzypedia'

If you have feedback or need assistance with the MCP directory API, please join our Discord server