Skip to main content
Glama

MinecraftWiki_getCategoriesForPage

Retrieve categories for a specific Minecraft Wiki page to organize content and understand page context.

Instructions

Get categories associated with a specific page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the Minecraft Wiki page

Implementation Reference

  • Implements the core logic for fetching categories associated with a Minecraft Wiki page using the MediaWiki API (prop=categories), handles errors, formats titles, and returns JSON response.
    async getCategoriesForPage(title: string): Promise<string> {
      const response = await apiService.get<WikiResponse, Record<string, unknown>>("", {
        action: "query",
        titles: title,
        prop: "categories",
      });
    
      const pages = response.query?.pages;
      if (!pages) {
        throw new Error(`Failed to get categories for "${title}"`);
      }
    
      const page = Object.values(pages)[0];
      if (page.missing) {
        throw new Error(`Page "${title}" not found`);
      }
    
      if (!page.categories?.length) {
        return JSON.stringify({
          title: formatMCPText(title),
          categories: [],
        });
      }
    
      return JSON.stringify({
        title: formatMCPText(title),
        categories: page.categories.map((cat) => formatMCPText(cat.title)),
      });
    }
  • Defines the MCP Tool schema including name, description, and input schema requiring a 'title' string parameter.
    export const GET_CATEGORIES_FOR_PAGE_MINECRAFTWIKI_TOOL: Tool = {
      name: "MinecraftWiki_getCategoriesForPage",
      description: "Get categories associated with a specific page.",
      inputSchema: {
        type: "object",
        properties: {
          title: {
            type: "string",
            description: "Title of the Minecraft Wiki page",
          },
        },
        required: ["title"],
      },
    };
  • src/server.ts:122-128 (registration)
    Registers the tool execution handler in the MCP server's CallToolRequestSchema, validates args with guard, and delegates to wikiService.getCategoriesForPage.
    case GET_CATEGORIES_FOR_PAGE_MINECRAFTWIKI_TOOL.name: {
      if (!isGetCategoriesForPageArgs(args)) {
        throw new Error("Invalid arguments for getCategoriesForPage");
      }
      const results = await wikiService.getCategoriesForPage(args.title);
      return { content: [{ type: "text", text: results }] };
    }
  • src/server.ts:48-60 (registration)
    Registers the tool in the ListToolsRequestSchema response, making it discoverable by MCP clients.
    // Register tool handlers
    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 to validate input arguments conform to the tool's schema (requires 'title' string). Used in tool handler registration.
    export function isGetCategoriesForPageArgs(args: unknown): args is { title: string } {
      return (
        typeof args === "object" &&
        args !== null &&
        "title" in args &&
        typeof (args as { title: string }).title === "string"
      );
    }
Behavior2/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 of behavioral disclosure. It states the action ('Get categories') but doesn't describe what the tool returns (e.g., list of category names, with metadata), potential errors (e.g., if the page doesn't exist), or performance aspects (e.g., rate limits). This leaves significant gaps for a tool that likely queries an external API.

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 a single, clear sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple tool, making it easy to parse quickly without unnecessary elaboration.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a list of categories, error formats), which is critical for a read-only query tool. While the purpose is clear, the absence of behavioral and output details makes it inadequate for full agent 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?

The input schema has 100% description coverage, with the 'title' parameter clearly documented. The description adds no additional meaning beyond the schema, as it doesn't elaborate on the 'title' parameter (e.g., formatting requirements or examples). With high schema coverage, the baseline score of 3 is appropriate, as the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('categories associated with a specific page'), making the purpose understandable. It distinguishes from siblings like 'listAllCategories' (which lists all categories) and 'getPageContent' (which gets page content), though it doesn't explicitly name these alternatives. However, it lacks specificity about what 'categories' means in the Minecraft Wiki context.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this tool is appropriate (e.g., for metadata about a page) or when to use siblings like 'listAllCategories' (for browsing all categories) or 'getPageContent' (for full page details). Without such context, the agent must infer usage from tool names alone.

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