get_eve_wiki_summary
Retrieve concise summaries of EVE University Wiki articles, with automatic fallback to Wayback Machine for uninterrupted access to EVE Online knowledge.
Instructions
Get a summary of an EVE University Wiki article (with Wayback Machine fallback)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the EVE University Wiki article |
Implementation Reference
- src/server.ts:95-112 (handler)The tool handler function that executes the tool logic by calling eveWikiClient.getSummary and formatting the JSON response with source detection.execute: async (args) => { try { const summary = await eveWikiClient.getSummary(args.title); const isArchived = summary.includes("(Retrieved from archived version)"); return JSON.stringify( { summary: summary, title: args.title, source: isArchived ? "wayback_machine" : "live_wiki", }, null, 2, ); } catch (error) { return `Error getting summary: ${error}`; } },
- src/server.ts:114-116 (schema)Zod input schema defining the 'title' parameter for the tool.parameters: z.object({ title: z.string().describe("Title of the EVE University Wiki article"), }),
- src/server.ts:88-117 (registration)Registration of the 'get_eve_wiki_summary' tool using FastMCP server.addTool, including annotations, description, name, handler, and parameters.server.addTool({ annotations: { openWorldHint: true, readOnlyHint: true, title: "Get EVE University Wiki Summary", }, description: "Get a summary of an EVE University Wiki article (with Wayback Machine fallback)", execute: async (args) => { try { const summary = await eveWikiClient.getSummary(args.title); const isArchived = summary.includes("(Retrieved from archived version)"); return JSON.stringify( { summary: summary, title: args.title, source: isArchived ? "wayback_machine" : "live_wiki", }, null, 2, ); } catch (error) { return `Error getting summary: ${error}`; } }, name: "get_eve_wiki_summary", parameters: z.object({ title: z.string().describe("Title of the EVE University Wiki article"), }), });
- src/eve-wiki-client.ts:366-414 (helper)Core implementation of summary retrieval using MediaWiki extracts API with retry logic and Wayback Machine fallback for archived content.async getSummary(title: string): Promise<string> { return this.retryableRequest(async () => { try { const response = await this.client.get("", { params: { action: "query", exintro: true, explaintext: true, exsectionformat: "plain", format: "json", prop: "extracts", titles: title, }, }); const pages = response.data?.query?.pages; if (!pages) { throw new Error("No pages found"); } const pageId = Object.keys(pages)[0]; const page = pages[pageId]; if (page.missing) { throw new Error(`Article "${title}" not found`); } return page.extract || "No summary available"; } catch (error) { console.error("Primary EVE Wiki summary request failed, trying Wayback Machine fallback:", error); // Try Wayback Machine fallback try { const articleUrl = `https://wiki.eveuniversity.org/wiki/${encodeURIComponent(title.replace(/ /g, '_'))}`; const waybackContent = await this.getWaybackContent(articleUrl); const textContent = this.extractTextFromHtml(waybackContent); // Extract first paragraph as summary const paragraphs = textContent.split('\n\n').filter(p => p.trim().length > 0); const summary = paragraphs[0] || textContent.substring(0, 500); return `${summary} (Retrieved from archived version)`; } catch (waybackError) { console.error("Wayback Machine fallback also failed:", waybackError); throw new Error(`Failed to get summary for "${title}" from both primary source and Wayback Machine`); } } }); }