Skip to main content
Glama
socialMediaHooksResource.ts1.87 kB
import type { HookData } from "../types/hooks.js"; export function createSocialMediaHooksResource(hooksData: HookData) { return { uri: "vibe://hooks/social-media-hooks", metadata: { title: "Social Media Hooks", description: "Comprehensive collection of hooks for various social media platforms organized by network and category", mimeType: "application/x-yaml", }, handler: async (uri: URL) => { // Reconstruct the YAML content from the loaded data let yamlContent = "networks:\n"; // Add networks for (const [networkKey, network] of Object.entries(hooksData.networks)) { yamlContent += ` ${networkKey}:\n`; yamlContent += ` name: "${network.name}"\n`; yamlContent += ` categories:\n`; // Add categories for each network for (const [categoryKey, category] of Object.entries( network.categories, )) { yamlContent += ` ${categoryKey}:\n`; yamlContent += ` name: "${category.name}"\n`; yamlContent += ` hooks:\n`; // Add hooks for (const hook of category.hooks) { yamlContent += ` - "${hook}"\n`; } } } // Add global categories yamlContent += "\ncategories:\n"; yamlContent += " global:\n"; for (const [categoryKey, category] of Object.entries( hooksData.categories.global, )) { yamlContent += ` ${categoryKey}:\n`; yamlContent += ` description: "${category.description}"\n`; yamlContent += ` keywords: [${category.keywords.map((k: string) => `"${k}"`).join(", ")}]\n`; } // Add usage tips yamlContent += "\nusage_tips:\n"; for (const [tipKey, tipValue] of Object.entries(hooksData.usage_tips)) { yamlContent += ` ${tipKey}: "${tipValue}"\n`; } return { contents: [ { uri: uri.href, text: yamlContent, }, ], }; }, }; }

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