search_prompts
Find AI prompts by keyword, type, category, or tag to discover community-curated prompts for various AI tasks.
Instructions
Search for AI prompts by keyword. Returns matching prompts with title, description, content, author, category, and tags.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query to find relevant prompts | |
| limit | No | Maximum number of prompts to return (default 10, max 50) | |
| type | No | Filter by prompt type | |
| category | No | Filter by category slug | |
| tag | No | Filter by tag slug |
Implementation Reference
- src/index.ts:148-173 (handler)Handler function that implements the search_prompts tool logic by proxying the tool call to the upstream prompts.chat MCP server using callPromptsChatMcp.async ({ query, limit, type, category, tag }) => { try { const response = await callPromptsChatMcp("tools/call", { name: "search_prompts", arguments: { query, limit, type, category, tag }, }); if (response.error) { return { content: [{ type: "text" as const, text: JSON.stringify({ error: response.error.message }) }], isError: true, }; } const result = response.result as { content: Array<{ type: string; text: string }> }; return { content: [{ type: "text" as const, text: result.content[0].text }], }; } catch (error) { const message = error instanceof Error ? error.message : String(error); return { content: [{ type: "text" as const, text: JSON.stringify({ error: message }) }], isError: true, }; } }
- src/index.ts:128-147 (schema)Input schema definition for the search_prompts tool, including title, description, and Zod-based parameter validation.{ title: "Search Prompts", description: "Search for AI prompts by keyword. Returns matching prompts with title, description, content, author, category, and tags.", inputSchema: { query: z.string().describe("Search query to find relevant prompts"), limit: z .number() .min(1) .max(50) .default(10) .describe("Maximum number of prompts to return (default 10, max 50)"), type: z .enum(["TEXT", "STRUCTURED", "IMAGE", "VIDEO", "AUDIO"]) .optional() .describe("Filter by prompt type"), category: z.string().optional().describe("Filter by category slug"), tag: z.string().optional().describe("Filter by tag slug"), }, },
- src/index.ts:125-174 (registration)Registration of the search_prompts tool on the MCP server using server.registerTool, specifying name, schema, and handler.// Tool: search_prompts server.registerTool( "search_prompts", { title: "Search Prompts", description: "Search for AI prompts by keyword. Returns matching prompts with title, description, content, author, category, and tags.", inputSchema: { query: z.string().describe("Search query to find relevant prompts"), limit: z .number() .min(1) .max(50) .default(10) .describe("Maximum number of prompts to return (default 10, max 50)"), type: z .enum(["TEXT", "STRUCTURED", "IMAGE", "VIDEO", "AUDIO"]) .optional() .describe("Filter by prompt type"), category: z.string().optional().describe("Filter by category slug"), tag: z.string().optional().describe("Filter by tag slug"), }, }, async ({ query, limit, type, category, tag }) => { try { const response = await callPromptsChatMcp("tools/call", { name: "search_prompts", arguments: { query, limit, type, category, tag }, }); if (response.error) { return { content: [{ type: "text" as const, text: JSON.stringify({ error: response.error.message }) }], isError: true, }; } const result = response.result as { content: Array<{ type: string; text: string }> }; return { content: [{ type: "text" as const, text: result.content[0].text }], }; } catch (error) { const message = error instanceof Error ? error.message : String(error); return { content: [{ type: "text" as const, text: JSON.stringify({ error: message }) }], isError: true, }; } } );