search_prompts
Find development prompts by keyword or tag to streamline AI-powered workflows, including UI/UX design, project setup, and debugging tasks.
Instructions
Search for prompts by keyword or tag
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query |
Implementation Reference
- src/server.ts:178-197 (handler)MCP tool handler for 'search_prompts' in CallToolRequestSchema. Validates input query, calls promptManager.searchPrompts, and returns JSON-formatted results.case "search_prompts": if (!args || typeof args.query !== "string") { throw new McpError( ErrorCode.InvalidRequest, "Query parameter is required" ); } const results = await this.promptManager.searchPrompts(args.query); logger.info( `Search results for "${args.query}": ${results.length} prompts` ); return { content: [ { type: "text", text: JSON.stringify(results, null, 2), }, ], };
- src/prompt-manager.ts:151-191 (helper)Core search logic in PromptManager that computes relevance scores for prompts based on query matches in title (3pts), description (2pts), tags (1pt), category (1pt), sorts by score descending.async searchPrompts(query: string): Promise<PromptWithScore[]> { const lowercaseQuery = query.toLowerCase(); const results: PromptWithScore[] = []; for (const prompt of this.prompts.values()) { let score = 0; // Check title if (prompt.title.toLowerCase().includes(lowercaseQuery)) { score += 3; } // Check description if ( prompt.description && prompt.description.toLowerCase().includes(lowercaseQuery) ) { score += 2; } // Check tags if ( prompt.tags && prompt.tags.some((tag) => tag.toLowerCase().includes(lowercaseQuery)) ) { score += 1; } // Check category if (prompt.category.toLowerCase().includes(lowercaseQuery)) { score += 1; } if (score > 0) { results.push({ ...prompt, searchScore: score }); } } // Sort by score (descending) return results.sort((a, b) => b.searchScore - a.searchScore); }
- src/prompt-types.ts:55-57 (schema)TypeScript interface defining the input schema for search_prompts tool: { query: string }.export interface SearchPromptsRequest { query: string; }