maasy_generate_content
Generate social media content aligned with your brand identity. Supply a creation prompt and optionally specify platform. Content respects brand DNA, tone, and ideal customer profile.
Instructions
Generate on-brand social content using maasy AI. Respects brand DNA, tone, ICP.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Brand UUID | |
| prompt | Yes | What to generate (e.g. '3 Instagram posts about our product launch') | |
| platform | No | general |
Implementation Reference
- src/index.ts:248-260 (registration)Registers the 'maasy_generate_content' tool with the MCP server, defining its input schema (project_id, prompt, platform) and delegating execution to toolHandler('generate_content').
server.tool( "maasy_generate_content", "Generate on-brand social content using maasy AI. Respects brand DNA, tone, ICP.", { project_id: z.string().optional().describe("Brand UUID"), prompt: z.string().describe("What to generate (e.g. '3 Instagram posts about our product launch')"), platform: z .enum(["instagram", "facebook", "linkedin", "twitter", "tiktok", "general"]) .optional() .default("general"), }, toolHandler("generate_content") ); - src/index.ts:251-258 (schema)Zod schema for maasy_generate_content: optional project_id, required prompt string, optional platform enum (instagram, facebook, linkedin, twitter, tiktok, general) defaulting to 'general'.
{ project_id: z.string().optional().describe("Brand UUID"), prompt: z.string().describe("What to generate (e.g. '3 Instagram posts about our product launch')"), platform: z .enum(["instagram", "facebook", "linkedin", "twitter", "tiktok", "general"]) .optional() .default("general"), }, - src/index.ts:26-43 (handler)Generic toolHandler wrapper that calls callGateway(toolName, args) to invoke the 'generate_content' tool via the Supabase edge function gateway, returning the result as text content.
function toolHandler(toolName: string, argsFn?: (args: Record<string, unknown>) => Record<string, unknown>) { return async (args: Record<string, unknown>) => { try { const gatewayArgs = argsFn ? argsFn(args) : args; // Auto-inject default project_id if not provided if (DEFAULT_PROJECT_ID && !gatewayArgs.project_id) { gatewayArgs.project_id = DEFAULT_PROJECT_ID; } const result = await callGateway(toolName, gatewayArgs); return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }] }; } catch (e: unknown) { return { content: [{ type: "text" as const, text: `Error: ${e instanceof Error ? e.message : String(e)}` }], isError: true, }; } }; } - src/supabase.ts:42-59 (helper)The callGateway function that sends the tool name ('generate_content') and args to the mcp-gateway Supabase edge function, handling auth and response parsing.
export async function callGateway(tool: string, args: Record<string, unknown> = {}): Promise<unknown> { const res = await fetch(gatewayUrl, { method: "POST", headers: { "Content-Type": "application/json", [authHeader.name]: authHeader.value, }, body: JSON.stringify({ tool, args }), }); const data = await res.json(); if (!res.ok) { throw new Error(data.error || `Gateway error (${res.status})`); } return data.result; }