read_page
Retrieve the raw wikitext content of any Wizzypedia page by specifying its title using this MCP-enabled tool on the Wizzypedia MCP Server.
Instructions
Fetch the raw wikitext content of a page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the page to read |
Implementation Reference
- index.ts:661-710 (handler)Executes the read_page tool: fetches page content using wikiClient.getPage(title), handles missing pages, and returns JSON with title, content, and last edit info.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 ) } ] }; }
- index.ts:486-499 (schema)Input schema for read_page tool, requiring a 'title' string parameter.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)Registers the read_page tool (as READ_PAGE_TOOL) in the list of available tools returned by ListToolsRequest.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ SEARCH_PAGES_TOOL, READ_PAGE_TOOL, CREATE_PAGE_TOOL, UPDATE_PAGE_TOOL, GET_PAGE_HISTORY_TOOL, GET_CATEGORIES_TOOL ] }));
- index.ts:390-398 (helper)MediaWikiClient.getPage method: performs the API query to retrieve the wikitext content and metadata of the specified page.async getPage(title: string): Promise<any> { return this.makeApiCall({ action: "query", prop: "revisions", titles: title, rvprop: "content|timestamp|user|comment", rvslots: "main" }); }