Skip to main content
Glama

MinecraftWiki_getPageSection

Retrieve a specific section from a Minecraft Wiki page by providing the page title and section index. Use after obtaining the page summary to access detailed content in the desired section.

Instructions

Get a specific section from a Minecraft Wiki page. Should be used as step 3 after searching for the page and getting its summary. The section index corresponds to the order of sections on the page, starting with 0 for the main content, 1 for the first section, 2 for the second section, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectionIndexYesIndex of the section to retrieve (0 = main, 1 = first section, 2 = second section, etc.)
titleYesTitle of the Minecraft Wiki page

Implementation Reference

  • Core handler function that fetches a specific section from the Minecraft Wiki page using the parse API, sanitizes the HTML content, formats it, and returns as JSON.
    async getPageSection(title: string, sectionIndex: number): Promise<string> { const response = await apiService.get<WikiResponse, Record<string, unknown>>("", { action: "parse", page: title, section: sectionIndex, }); if (!response.parse?.text?.["*"]) { throw new Error(`No content found for section ${sectionIndex} of "${title}"`); } const content = sanitizeWikiContent(response.parse.text["*"]); return JSON.stringify({ title: formatMCPText(title), sectionIndex: sectionIndex, content: content, }); }
  • Defines the input/output schema for the tool, including name, description, and validation rules.
    export const GET_PAGE_SECTION_MINECRAFTWIKI_TOOL: Tool = { name: "MinecraftWiki_getPageSection", description: "Get a specific section from a Minecraft Wiki page. Should be used as step 3 after searching for the page and getting its summary. The section index corresponds to the order of sections on the page, starting with 0 for the main content, 1 for the first section, 2 for the second section, etc.", inputSchema: { type: "object", properties: { title: { type: "string", description: "Title of the Minecraft Wiki page", }, sectionIndex: { type: "number", description: "Index of the section to retrieve (0 = main, 1 = first section, 2 = second section, etc.)", }, }, required: ["title", "sectionIndex"], }, };
  • src/server.ts:49-61 (registration)
    Registers the tool in the MCP server's listTools handler, making it discoverable.
    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, ], }));
  • src/server.ts:82-88 (registration)
    Dispatches calls to the tool handler in the MCP server's callTool request handler.
    case GET_PAGE_SECTION_MINECRAFTWIKI_TOOL.name: { if (!isGetPageSectionArgs(args)) { throw new Error("Invalid arguments for getPageSection"); } const section = await wikiService.getPageSection(args.title, args.sectionIndex); return { content: [{ type: "text", text: section }] }; }
  • Type guard function for validating input arguments against the tool schema.
    export function isGetPageSectionArgs( args: unknown ): args is { title: string; sectionIndex: number } { return ( typeof args === "object" && args !== null && "title" in args && typeof (args as { title: string }).title === "string" && "sectionIndex" in args && typeof (args as { sectionIndex: number }).sectionIndex === "number" ); }

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/L3-N0X/Minecraft-Wiki-MCP'

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