Skip to main content
Glama
cryppadotta
by cryppadotta

get_categories

Retrieve the categories associated with a specific Wizzypedia page by providing its title. This tool helps organize and classify wiki content for better navigation and content management.

Instructions

Get categories a page belongs to

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the page

Implementation Reference

  • Main handler for the 'get_categories' tool call within the MCP server's CallToolRequestSchema handler. Extracts the title argument, calls wikiClient.getCategories(title), processes the MediaWiki API response to handle missing pages and extract category titles, then returns a formatted JSON response.
    case "get_categories": {
      const { title } = request.params.arguments as { title: string };
      const result = await wikiClient.getCategories(title);
    
      const pages = result.query.pages;
      const page = pages[0];
    
      if (page.missing) {
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(
                {
                  title: page.title,
                  exists: false,
                  message: "Page does not exist"
                },
                null,
                2
              )
            }
          ]
        };
      }
    
      const categories = page.categories
        ? page.categories.map((cat: any) => cat.title)
        : [];
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                title: page.title,
                categories
              },
              null,
              2
            )
          }
        ]
      };
    }
  • Tool schema definition for 'get_categories', including name, description, and input schema requiring a 'title' string.
    const GET_CATEGORIES_TOOL: Tool = {
      name: "get_categories",
      description: "Get categories a page belongs to",
      inputSchema: {
        type: "object",
        properties: {
          title: {
            type: "string",
            description: "Title of the page"
          }
        },
        required: ["title"]
      }
    };
  • index.ts:598-607 (registration)
    Registration of the 'get_categories' tool (via GET_CATEGORIES_TOOL) in the list tools request handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        SEARCH_PAGES_TOOL,
        READ_PAGE_TOOL,
        CREATE_PAGE_TOOL,
        UPDATE_PAGE_TOOL,
        GET_PAGE_HISTORY_TOOL,
        GET_CATEGORIES_TOOL
      ]
    }));
  • Helper method in MediaWikiClient class that performs the actual API call to retrieve categories for a given page title.
    async getCategories(title: string): Promise<any> {
      return this.makeApiCall({
        action: "query",
        prop: "categories",
        titles: title,
        cllimit: "max"
      });
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It implies a read-only operation ('Get') but doesn't specify aspects like authentication needs, rate limits, error conditions, or what happens if the page doesn't exist. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 extremely concise and front-loaded, consisting of a single, clear sentence that directly states the tool's purpose without any wasted words. Every part of the sentence earns its place by conveying essential information, making it efficient and easy to parse.

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 for effective tool use. It doesn't explain what the tool returns (e.g., a list of category names, IDs, or full objects), error handling, or dependencies. For a tool with no structured output or behavioral hints, the description should provide more context to compensate.

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 fully documented in the schema itself. The description adds no additional meaning beyond what the schema provides (e.g., it doesn't clarify format expectations or edge cases for the title). Thus, it meets the baseline score of 3, as the schema handles the heavy lifting for parameter semantics.

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 tool's purpose with a specific verb ('Get') and resource ('categories a page belongs to'), making it immediately understandable. It distinguishes itself from siblings like 'get_page_history' or 'read_page' by focusing on page categorization rather than content or history. However, it doesn't explicitly differentiate from all siblings (e.g., 'search_pages' might also involve categories), keeping it from a perfect score.

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 prerequisites (e.g., needing an existing page), exclusions, or comparisons to siblings like 'search_pages' which might also retrieve category-related data. Without such context, the agent must infer usage based on the tool name 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/cryppadotta/mcp-wizzypedia'

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