Skip to main content
Glama

list_prompts

Browse available prompt templates by category to find reusable workflows for tasks like daily planning, code review, and document summarization.

Instructions

List all available prompt templates, optionally filtered by category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category

Implementation Reference

  • Handler function for the 'list_prompts' tool. Retrieves prompts from the registry (filtered by optional category), formats them into a JSON structure with count and details (id, name, description, category, param count, tags), and returns as text content.
    async (args) => { const prompts = registry.prompts.list(args.category as PromptCategory); return { content: [ { type: "text", text: JSON.stringify( { count: prompts.length, prompts: prompts.map((p) => ({ id: p.id, name: p.name, description: p.description, category: p.category, parameters: p.parameters.length, tags: p.tags, })), }, null, 2 ), }, ], }; }
  • Input schema for 'list_prompts' tool using Zod. Defines an optional 'category' parameter enum with predefined prompt categories.
    { category: z .enum(["productivity", "code", "research", "communication", "general"]) .optional() .describe("Filter by category"), },
  • Registration of the 'list_prompts' MCP tool on the McpServer instance within registerPromptTools function.
    server.tool( "list_prompts", "List all available prompt templates, optionally filtered by category", { category: z .enum(["productivity", "code", "research", "communication", "general"]) .optional() .describe("Filter by category"), }, async (args) => { const prompts = registry.prompts.list(args.category as PromptCategory); return { content: [ { type: "text", text: JSON.stringify( { count: prompts.length, prompts: prompts.map((p) => ({ id: p.id, name: p.name, description: p.description, category: p.category, parameters: p.parameters.length, tags: p.tags, })), }, null, 2 ), }, ], }; } );

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/ishuru/open-mcp'

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