html-ad-generator-mcp
Version:
MCP server for generating HTML ad templates from JSON input for Google Ads and Meta Ads
35 lines • 1.44 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
});
// Combined Schema
export const AdInputSchema = z.union([GoogleAdInputSchema, MetaAdInputSchema]);
//# sourceMappingURL=schemas.js.map