search_prompts
Find prompt templates for productivity automation by entering a search query to access reusable templates for tasks like planning, code review, and summarization.
Instructions
Search for prompt templates by query string
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query |
Implementation Reference
- src/prompts/prompts.ts:178-203 (handler)MCP tool handler for 'search_prompts': invokes registry.prompts.search(query) and formats results as JSON.async (args) => { const prompts = registry.prompts.search(args.query); return { content: [ { type: "text", text: JSON.stringify( { query: args.query, count: prompts.length, results: prompts.map((p) => ({ id: p.id, name: p.name, description: p.description, category: p.category, tags: p.tags, })), }, null, 2 ), }, ], }; }
- src/prompts/prompts.ts:176-177 (schema)Zod input schema defining the 'query' parameter as a required string.query: z.string().describe("Search query"), },
- src/prompts/prompts.ts:172-204 (registration)Registers the 'search_prompts' tool on the MCP server within registerPromptTools function.server.tool( "search_prompts", "Search for prompt templates by query string", { query: z.string().describe("Search query"), }, async (args) => { const prompts = registry.prompts.search(args.query); return { content: [ { type: "text", text: JSON.stringify( { query: args.query, count: prompts.length, results: prompts.map((p) => ({ id: p.id, name: p.name, description: p.description, category: p.category, tags: p.tags, })), }, null, 2 ), }, ], }; } );
- src/core/prompt-manager.ts:211-219 (helper)Implements the prompt search logic by filtering templates matching the query in name, description, or tags.search(query: string): PromptTemplate[] { const lowerQuery = query.toLowerCase(); return Array.from(this.templates.values()).filter( (t) => t.name.toLowerCase().includes(lowerQuery) || t.description.toLowerCase().includes(lowerQuery) || t.tags?.some((tag) => tag.toLowerCase().includes(lowerQuery)) ); }