html-ad-generator-mcp
Version:
MCP server for generating HTML ad templates from JSON input for Google Ads, Meta Ads, and Moment Science
49 lines • 2.11 kB
JavaScript
import { z } from 'zod';
// Google Ads Schemas
export const GoogleSearchAdSchema = z.object({
headlines: z.array(z.string().max(30)).min(1).max(5),
descriptions: z.array(z.string().max(90)).min(1).max(5)
});
export const GoogleDisplayAdSchema = z.object({
headline: z.array(z.string().max(30)).min(1).max(5),
longHeadline: z.array(z.string().max(90)).min(1).max(5),
description: z.array(z.string().max(90)).min(1).max(5),
businessName: z.string().max(25),
imageUrl: z.string().url().optional()
});
export const GoogleAdInputSchema = z.object({
platform: z.literal('google'),
searchAd: GoogleSearchAdSchema, // Now required (removed .optional())
displayAd: GoogleDisplayAdSchema // Now required (removed .optional())
});
// Meta Ads Schema
export const MetaAdContentSchema = z.object({
headline: z.array(z.string().max(40)).min(1).max(5),
description: z.array(z.string().max(30)).min(1).max(5),
primaryText: z.array(z.string().max(125)).min(1).max(5),
cta: z.array(z.string()).min(1).max(5),
businessName: z.string().optional(),
profileImageUrl: z.string().url().optional(),
mainImageUrl: z.string().url().optional()
});
export const MetaAdInputSchema = z.object({
platform: z.literal('meta'),
content: MetaAdContentSchema
});
// Moment Science Ads Schema
export const MomentScienceAdContentSchema = z.object({
headline: z.array(z.string().max(90)).min(3).max(5),
description: z.array(z.string().max(220)).min(3).max(5),
short_headline: z.array(z.string().max(60)).min(3).max(5),
short_description: z.array(z.string().max(140)).min(3).max(5),
positive_cta: z.array(z.string().max(25)).min(3).max(5),
negative_cta: z.array(z.string().max(25)).min(3).max(5),
imageUrl: z.string().url().optional()
});
export const MomentScienceAdInputSchema = z.object({
platform: z.literal('moment-science'),
content: MomentScienceAdContentSchema
});
// Combined Schema
export const AdInputSchema = z.union([GoogleAdInputSchema, MetaAdInputSchema, MomentScienceAdInputSchema]);
//# sourceMappingURL=schemas.js.map