Skip to main content
Glama

list_prompts

Browse available prompt templates for productivity, code, research, communication, and general tasks, with optional category filtering.

Instructions

List all available prompt templates, optionally filtered by category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category

Implementation Reference

  • The handler function for the 'list_prompts' MCP tool. It lists prompts from the registry (optionally filtered by category) and returns a JSON-formatted response.
    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 ), }, ], }; } );
  • Zod input schema for the 'list_prompts' tool defining an optional 'category' parameter.
    { category: z .enum(["productivity", "code", "research", "communication", "general"]) .optional() .describe("Filter by category"), },
  • MCP tool registration for 'list_prompts' via server.tool(), including name, description, input schema, and handler.
    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 ), }, ], }; } );
  • Core 'list()' method in PromptManager that provides the prompt listing logic used by the tool handler, filtering by category if specified.
    list(category?: PromptCategory): PromptTemplate[] { const all = Array.from(this.templates.values()); if (category) { return all.filter((t) => t.category === category); } return all; }
  • src/index.ts:71-71 (registration)
    Top-level call to registerPromptTools which includes the list_prompts tool registration.
    registerPromptTools(server);

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