Skip to main content
Glama
findHooksTool.ts1.38 kB
import { z } from "zod"; import type { HookSearchService } from "../services/hookSearchService.js"; export const findHooksToolDefinition = { name: "find-hooks", title: "Find Social Media Hooks", description: "Find social media hooks by network and/or category", inputSchema: { network: z .string() .optional() .describe( "Social media network (twitter, instagram, linkedin, tiktok, youtube)", ), category: z .string() .optional() .describe( "Hook category (engagement, educational, promotional, storytelling, etc.)", ), limit: z .number() .optional() .default(10) .describe("Maximum number of hooks to return"), }, }; export const findHooksHandler = (hookSearchService: HookSearchService) => async ({ network, category, limit = 10, }: { network?: string; category?: string; limit?: number; }) => { try { const results = hookSearchService.searchHooks({ network, category, limit, }); const responseText = hookSearchService.formatResults(results); return { content: [ { type: "text" as const, text: responseText, }, ], }; } catch (error) { return { content: [ { type: "text" as const, text: `Error reading hooks data: ${error instanceof Error ? error.message : "Unknown error"}`, }, ], isError: true, }; } };

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/synthetic-ci/vibe-marketing'

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