MinecraftWiki_resolveRedirect
Resolve Minecraft Wiki page redirects to retrieve the correct title, simplifying access to precise information on Minecraft-related topics.
Instructions
Resolve a redirect and return the title of the target page.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the page to resolve the redirect for. |
Implementation Reference
- src/services/wiki.service.ts:120-141 (handler)The core handler function in WikiService that executes the tool logic: queries the MediaWiki API with redirects=true to resolve the page title and returns JSON with original and resolved titles.async resolveRedirect(title: string): Promise<string> { const response = await apiService.get<WikiResponse, Record<string, unknown>>("", { action: "query", titles: title, redirects: true, }); const pages = response.query?.pages; if (!pages) { throw new Error(`Failed to resolve redirect for "${title}"`); } const page = Object.values(pages)[0]; if (page.missing) { throw new Error(`Page "${title}" not found`); } return JSON.stringify({ originalTitle: formatMCPText(title), resolvedTitle: formatMCPText(page.title), }); }
- src/types/tools.ts:76-89 (schema)Tool schema defining the name 'MinecraftWiki_resolveRedirect', description, and input schema requiring a 'title' string.export const RESOLVE_REDIRECT_MINECRAFTWIKI_TOOL: Tool = { name: "MinecraftWiki_resolveRedirect", description: "Resolve a redirect and return the title of the target page.", inputSchema: { type: "object", properties: { title: { type: "string", description: "Title of the page to resolve the redirect for.", }, }, required: ["title"], }, };
- src/server.ts:106-112 (registration)Registration of the tool handler in the MCP server's CallToolRequestSchema switch statement: validates arguments using guard and delegates to wikiService.resolveRedirect.case RESOLVE_REDIRECT_MINECRAFTWIKI_TOOL.name: { if (!isResolveRedirectArgs(args)) { throw new Error("Invalid arguments for resolveRedirect"); } const resolvedTitle = await wikiService.resolveRedirect(args.title); return { content: [{ type: "text", text: resolvedTitle }] }; }
- src/server.ts:49-60 (registration)Tool registration in the ListToolsRequestSchema handler, where the schema is included in the list of available tools.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ SEARCH_WIKI_MINECRAFTWIKI_TOOL, GET_PAGE_SUMMARY_MINECRAFTWIKI_TOOL, GET_SECTIONS_IN_PAGE_MINECRAFTWIKI_TOOL, GET_PAGE_SECTION_MINECRAFTWIKI_TOOL, GET_PAGE_CONTENT_MINECRAFTWIKI_TOOL, RESOLVE_REDIRECT_MINECRAFTWIKI_TOOL, LIST_CATEGORY_MEMBERS_MINECRAFTWIKI_TOOL, LIST_ALL_CATEGORIES_MINECRAFTWIKI_TOOL, GET_CATEGORIES_FOR_PAGE_MINECRAFTWIKI_TOOL, ],