categories
List available ASCII art and kaomoji collections to browse organized visual content for AI agents, CLI tools, and chatbots.
Instructions
List all categories.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp.ts:91-94 (handler)MCP tool 'categories' registration and handler. The tool is registered with server.tool() and the handler logic directly calls listCategories() to get all categories and returns them as a comma-separated string.
server.tool('categories', 'List all categories.', {}, async () => { const cats = listCategories(); return { content: [{ type: 'text', text: cats.join(', ') }] }; }); - src/store.ts:54-56 (handler)listCategories() function implementation in the store module. This function retrieves all unique categories from the ASCII art entries by delegating to uniqueCategories().
export function listCategories(): string[] { return uniqueCategories(entries); } - src/searchable.ts:33-35 (helper)uniqueCategories() helper function that extracts unique category values from an array of Searchable entries using a Set to deduplicate.
export function uniqueCategories<T extends Searchable>(entries: T[]): string[] { return [...new Set(entries.map((e) => e.category))]; } - src/mcp.ts:1-12 (registration)Import statements showing the listCategories function is imported from the store module, establishing the dependency chain for the categories tool.
#!/usr/bin/env node import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; import { z } from 'zod'; import { loadIndex, search, getById, getRandom, listCategories, listAll, toResult, addArt, deleteArt } from './store.js'; import { loadKaomoji, searchKaomoji, getRandomKaomoji, listKaomojiCategories, getKaomojiByCategory, toKaomojiResult } from './kaomoji.js'; import { MAX_NAME_LENGTH, MAX_TAG_LENGTH, MAX_TAGS, MAX_DESCRIPTION_LENGTH, SIZE_LIMITS, DEFAULT_SIZE } from './constants.js'; import { resolveImageInput } from './resolve.js'; import { convertImage } from './converter.js'; import { renderBanner, BANNER_FONTS } from './banner.js'; import type { ArtSize } from './types.js';