Skip to main content
Glama
cryppadotta
by cryppadotta

read_page

Fetch raw wikitext content from Wizzypedia pages to access and work with article source material directly.

Instructions

Fetch the raw wikitext content of a page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the page to read

Implementation Reference

  • Handler function for executing the read_page tool. Extracts title from arguments, calls wikiClient.getPage(title), processes the result to extract content and metadata, handles missing pages, and returns formatted JSON response.
    case "read_page": {
      const { title } = request.params.arguments as { title: string };
      const result = await wikiClient.getPage(title);
    
      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 revision = page.revisions[0];
      const content = revision.slots.main.content;
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                title: page.title,
                content: content,
                lastEdit: {
                  timestamp: revision.timestamp,
                  user: revision.user,
                  comment: revision.comment
                }
              },
              null,
              2
            )
          }
        ]
      };
    }
  • Tool definition including name, description, and input schema for read_page tool, which requires a 'title' string.
    const READ_PAGE_TOOL: Tool = {
      name: "read_page",
      description: "Fetch the raw wikitext content of a page",
      inputSchema: {
        type: "object",
        properties: {
          title: {
            type: "string",
            description: "Title of the page to read"
          }
        },
        required: ["title"]
      }
    };
  • index.ts:598-607 (registration)
    Registration of all tools including read_page (READ_PAGE_TOOL) in the 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
      ]
    }));
  • MediaWikiClient.getPage method: makes API call to query revisions of a page by title, retrieving content, timestamp, user, and comment.
    async getPage(title: string): Promise<any> {
      return this.makeApiCall({
        action: "query",
        prop: "revisions",
        titles: title,
        rvprop: "content|timestamp|user|comment",
        rvslots: "main"
      });
    }

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