Skip to main content
Glama

MinecraftWiki_getPageSection

Retrieve a specific section from a Minecraft Wiki page by providing the page title and section index number to access detailed information.

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
titleYesTitle of the Minecraft Wiki page
sectionIndexYesIndex of the section to retrieve (0 = main, 1 = first section, 2 = second section, etc.)

Implementation Reference

  • The main handler function that implements the tool logic by calling the MediaWiki parse API to retrieve a specific section of a page, sanitizes the content, and returns formatted 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,
      });
    }
  • The Tool object defining the schema, name, description, and input schema (title: string, sectionIndex: number) for the MinecraftWiki_getPageSection tool.
    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:82-88 (registration)
    Registration of the tool handler in the MCP server's CallToolRequestSchema switch statement, which validates arguments using the guard and calls the wikiService 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 }] };
    }
  • src/server.ts:49-60 (registration)
    Registration of the tool in the ListToolsRequestSchema handler, making it discoverable by clients.
    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,
      ],
  • Type guard function for validating input arguments matching the tool schema (title: string, sectionIndex: number).
    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"
      );
    }
  • Helper function to sanitize wiki HTML content by removing tags, decoding escapes, and formatting for MCP compatibility, used in the handler.
    export function sanitizeWikiContent(text: string): string {
      return formatMCPText(
        // First decode any Unicode escapes
        decodeUnicodeEscapes(
          // Remove HTML tags
          text.replace(/<[^>]*>/g, " ")
        )
      );
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It explains the section indexing system (starting at 0 for main content) and the sequential workflow, but doesn't disclose error handling, rate limits, authentication needs, or what happens with invalid inputs. For a tool with no annotations, this leaves behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core purpose and followed by essential usage guidance. Every sentence adds value without redundancy, making it highly efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (2 parameters, no output schema, no annotations), the description is fairly complete. It covers purpose, usage workflow, and parameter semantics, but lacks details on return format, error cases, or performance constraints, which would be helpful for full contextual understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters fully. The description adds context about section indexing (0 = main, 1 = first section, etc.), which clarifies the 'sectionIndex' parameter beyond the schema's basic description. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verb ('Get') and resource ('a specific section from a Minecraft Wiki page'). It distinguishes from siblings like 'getPageContent' (entire page) and 'getPageSummary' (summary only) by focusing on sections.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'as step 3 after searching for the page and getting its summary.' It also implies alternatives by referencing previous steps (searching and getting summary), though it doesn't name specific sibling tools for comparison.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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