Skip to main content
Glama
LeonNonnast

Dev MCP Prompt Server

by LeonNonnast

search_prompts

Find development prompts for UI/UX design, project setup, and debugging by searching with keywords or tags to enhance AI-powered workflows.

Instructions

Search for prompts by keyword or tag

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query

Implementation Reference

  • Handler for the 'search_prompts' tool: validates input query, calls promptManager.searchPrompts, logs results, and returns JSON-formatted search 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),
          },
        ],
      };
  • Core implementation of prompt search: computes relevance score based on 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);
    }
  • Type definition for the input schema of the search_prompts tool, specifying the required 'query' string parameter.
    export interface SearchPromptsRequest {
      query: string;
    }

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/LeonNonnast/mcpdevprompts'

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