maasy_create_landing
Generate a landing page from HTML. Submit brand UUID, page name, and HTML content. Receive landing ID and editor URL to open in the builder.
Instructions
Create a landing page in maasy from HTML. Returns a landing_id and editor_url to open in the builder.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | No | Brand UUID | |
| name | Yes | Landing page name, e.g. 'Captación Q2 2026' | |
| html | Yes | Full HTML content of the landing page | |
| slug | No | URL slug (auto-generated from name if omitted) | |
| type | No | landing |
Implementation Reference
- src/index.ts:302-313 (registration)Tool registration for 'maasy_create_landing' on the MCP server with schema and handler binding.
server.tool( "maasy_create_landing", "Create a landing page in maasy from HTML. Returns a landing_id and editor_url to open in the builder.", { project_id: z.string().optional().describe("Brand UUID"), name: z.string().describe("Landing page name, e.g. 'Captación Q2 2026'"), html: z.string().describe("Full HTML content of the landing page"), slug: z.string().optional().describe("URL slug (auto-generated from name if omitted)"), type: z.enum(["landing", "squeeze", "sales", "webinar", "event"]).optional().default("landing"), }, toolHandler("create_landing") ); - src/index.ts:305-311 (schema)Input schema for the tool: project_id (optional), name (required), html (required), slug (optional), type (optional, defaults to 'landing').
{ project_id: z.string().optional().describe("Brand UUID"), name: z.string().describe("Landing page name, e.g. 'Captación Q2 2026'"), html: z.string().describe("Full HTML content of the landing page"), slug: z.string().optional().describe("URL slug (auto-generated from name if omitted)"), type: z.enum(["landing", "squeeze", "sales", "webinar", "event"]).optional().default("landing"), }, - src/index.ts:26-43 (handler)Generic toolHandler wrapper that all tools use. For 'maasy_create_landing', it invokes callGateway with toolName='create_landing' and passes the args through directly (no argsFn transformer).
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 actually sends the tool request (with toolName='create_landing' and args) as a POST to the mcp-gateway edge function. This is where the actual API call happens.
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; }