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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:288-311 (handler)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: {}, }, },
- src/index.ts:159-162 (schema)Input schema for 'list_categories' tool: an empty object, indicating no input parameters are needed.inputSchema: { type: "object", properties: {}, },