Skip to main content
Glama
Cicatriiz

Consumer Rights Wiki MCP Server

get_categories

Retrieve categories or pages within a specific category from the Consumer Rights Wiki. Specify a category name to filter results or list all categories. Supports limits for controlled output.

Instructions

Get all categories or pages in a specific category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoCategory name (without Category: prefix). If empty, lists all categories.
limitNoNumber of results to return (default: 20, max: 50)

Implementation Reference

  • Handler function that executes the get_categories tool. It either lists all categories or members of a specific category using the wiki's API endpoints (allcategories or categorymembers).
    private async getCategories(args: any) { const { category, limit = 20 } = args; if (category) { // Get pages in a specific category const data = await this.makeApiRequest({ action: 'query', list: 'categorymembers', cmtitle: `Category:${category}`, cmlimit: Math.min(limit, 50).toString(), cmprop: 'ids|title|timestamp', }); if (data.error) { throw new McpError(ErrorCode.InternalError, data.error.info); } const members = data.query?.categorymembers || []; return { content: [ { type: 'text', text: JSON.stringify({ category: `Category:${category}`, members: members.map((member: any) => ({ title: member.title, pageid: member.pageid, timestamp: member.timestamp, url: `${WIKI_BASE_URL}/${member.title.replace(/ /g, '_')}`, })), }, null, 2), }, ], }; } else { // List all categories const data = await this.makeApiRequest({ action: 'query', list: 'allcategories', aclimit: Math.min(limit, 50).toString(), acprop: 'size', }); if (data.error) { throw new McpError(ErrorCode.InternalError, data.error.info); } const categories = data.query?.allcategories || []; return { content: [ { type: 'text', text: JSON.stringify({ categories: categories.map((cat: any) => ({ name: cat['*'], size: cat.size, url: `${WIKI_BASE_URL}/Category:${cat['*'].replace(/ /g, '_')}`, })), }, null, 2), }, ], }; } }
  • src/index.ts:132-149 (registration)
    Tool registration in the ListToolsRequestHandler, including name, description, and input schema.
    { name: 'get_categories', description: 'Get all categories or pages in a specific category', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Category name (without Category: prefix). If empty, lists all categories.', }, limit: { type: 'number', description: 'Number of results to return (default: 20, max: 50)', default: 20, }, }, }, },
  • src/index.ts:177-178 (registration)
    Dispatch case in CallToolRequestHandler that routes calls to the getCategories handler.
    case 'get_categories': return this.getCategories(request.params.arguments);

Other Tools

Related 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/Cicatriiz/consumer-rights-wiki-mcp'

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