Skip to main content
Glama

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
NameRequiredDescriptionDefault
queryYesSearch query

Implementation Reference

  • 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
            ),
          },
        ],
      };
    }
  • Zod input schema defining the 'query' parameter as a required string.
      query: z.string().describe("Search query"),
    },
  • 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
              ),
            },
          ],
        };
      }
    );
  • 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))
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action ('search') but doesn't describe what 'search' entails—such as whether it returns partial matches, supports pagination, or has performance characteristics. For a search tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without any wasted words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for a search tool. It doesn't explain what the search returns (e.g., a list of templates, metadata), how results are structured, or any limitations. For a tool with no structured output information, this leaves critical gaps for the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'query' parameter documented as 'Search query'. The description adds no additional meaning beyond this, such as examples or format details. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('search') and resource ('prompt templates') with the method ('by query string'), making the purpose immediately understandable. However, it doesn't distinguish this tool from sibling tools like 'list_prompts' or 'get_prompt', which appear to be related to prompt operations, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_prompts' or 'get_prompt'. It mentions searching by query string, but doesn't specify scenarios, prerequisites, or exclusions, leaving the agent with minimal context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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