Skip to main content
Glama
dannwaneri

MCP Knowledge Base Server

by dannwaneri

list_categories

Retrieve all available knowledge base categories to organize and filter content for efficient information access.

Instructions

List all available knowledge base categories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'list_categories' tool. Extracts unique categories from the global knowledgeBase array using Set, formats them into a JSON response with count, caches the result, and returns it as text content.
    if (name === "list_categories") { const categories = [...new Set(knowledgeBase.map((item) => item.category))]; const responseText = JSON.stringify( { categories, count: categories.length, }, null, 2 ); // Cache the response setCache(cacheKey, responseText); return { content: [ { type: "text", text: responseText, }, ], }; }
  • src/index.ts:156-163 (registration)
    Registration of the 'list_categories' tool in the listTools response, including name, description, and empty input schema (no parameters required).
    { name: "list_categories", description: "List all available knowledge base categories", inputSchema: { type: "object", properties: {}, }, },
  • Input schema for 'list_categories' tool: an empty object, indicating no input parameters are needed.
    inputSchema: { type: "object", properties: {}, },

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/dannwaneri/mcp-knowledge-base-server'

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