Skip to main content
Glama
jezweb

Smart Prompts MCP Server

list_prompt_categories

Explore available prompt categories and their prompt counts to understand the library structure before searching or creating prompts.

Instructions

πŸ“‹ Overview: List all available prompt categories with prompt counts. Use this to explore the library structure and see what categories exist before searching or creating prompts. Great for discovering new areas.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'list_prompt_categories' tool. Retrieves categories from cache, counts prompts per category, formats a markdown response with category names and counts, and returns it as MCP text content.
    private handleListCategories(): CallToolResult { const categories = this.cache.getCategories(); const categoryCounts: Record<string, number> = {}; // Count prompts per category for (const prompt of this.cache.getAllPrompts()) { const cat = prompt.metadata.category || 'uncategorized'; categoryCounts[cat] = (categoryCounts[cat] || 0) + 1; } const text = `# Prompt Categories\n\n${categories.map(cat => `- **${cat}** (${categoryCounts[cat] || 0} prompts)` ).join('\n')}\n\nTotal: ${categories.length} categories`; return { content: [ { type: 'text', text, } as TextContent, ], }; }
  • Tool definition and registration in getToolDefinitions() method, including name, description, and empty input schema (no parameters required).
    { name: 'list_prompt_categories', description: 'πŸ“‹ Overview: List all available prompt categories with prompt counts. Use this to explore the library structure and see what categories exist before searching or creating prompts. Great for discovering new areas.', inputSchema: { type: 'object', properties: {}, description: 'No parameters needed. Returns all categories with prompt counts for easy browsing.', }, },
  • Dispatch case in handleToolCall() switch statement that routes calls to the list_prompt_categories handler.
    case 'list_prompt_categories': return this.handleListCategories();

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/jezweb/smart-prompts-mcp'

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