Skip to main content
Glama
Mike25app

scaleforge-mcp-meta-ads

create_ad_creative

Create a single-text ad creative for Facebook or Instagram by providing a page ID and either video data or link data with image hash, URL, and message. Supports Instagram placements via optional user ID.

Instructions

WRITE: Create a single-text ad creative from an object_story_spec. Pass page_id plus ONE of: video_data (for video ads — needs video_id from upload_video), link_data (for image / link ads — needs image_hash from upload_image + link + message). If the Page is not linked to Instagram, pass instagram_user_id from get_pbia() to enable IG placements.

Note: image hashes are per-ad-account in Meta — a hash uploaded on account A is NOT valid on account B. Re-upload to each target account.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_account_idYes'act_123' or '123'
nameYes
page_idYesFacebook Page ID (the advertiser)
instagram_user_idNoInstagram actor ID or PBIA id (from get_pbia). Optional.
video_idNoFrom upload_video
image_hashNoFrom upload_image
messageNoPrimary text / body copy
titleNoHeadline for link_data
linkNoLanding page URL (for link_data)
call_to_actionNoe.g. {type: 'SHOP_NOW', value: {link: 'https://...'}}
descriptionNo
url_tagsNoUTM tracking params
thumbnail_urlNo

Implementation Reference

  • The handler function for 'create_ad_creative'. It builds an object_story_spec with either video_data (if video_id provided) or link_data (if image_hash provided), then POSTs to /{ad_account_id}/adcreatives via metaPost.
    handler: async (args) => {
      const story: Record<string, unknown> = { page_id: args.page_id };
      if (args.instagram_user_id) story.instagram_user_id = args.instagram_user_id;
    
      if (args.video_id) {
        const video_data: Record<string, unknown> = { video_id: args.video_id };
        if (args.message) video_data.message = args.message;
        if (args.title) video_data.title = args.title;
        if (args.call_to_action) video_data.call_to_action = args.call_to_action;
        if (args.thumbnail_url) video_data.image_url = args.thumbnail_url;
        story.video_data = video_data;
      } else if (args.image_hash) {
        const link_data: Record<string, unknown> = { image_hash: args.image_hash };
        if (args.link) link_data.link = args.link;
        if (args.message) link_data.message = args.message;
        if (args.title) link_data.name = args.title;
        if (args.description) link_data.description = args.description;
        if (args.call_to_action) link_data.call_to_action = args.call_to_action;
        story.link_data = link_data;
      } else {
        throw new Error(
          "create_ad_creative needs either video_id (video ad) or image_hash + link (image/link ad).",
        );
      }
    
      const body: Record<string, unknown> = {
        name: args.name,
        object_story_spec: story,
      };
      if (args.url_tags) body.url_tags = args.url_tags;
    
      return metaPost(
        `/${toAdAccountPath(String(args.ad_account_id))}/adcreatives`,
        body,
      );
    },
  • Input schema for create_ad_creative defined with Zod. Validates ad_account_id, name, page_id, and optional fields: instagram_user_id, video_id, image_hash, message, title, link, call_to_action, description, url_tags, thumbnail_url.
    inputSchema: {
      ad_account_id: z.string().describe("'act_123' or '123'"),
      name: z.string().min(1),
      page_id: z.string().describe("Facebook Page ID (the advertiser)"),
      instagram_user_id: z
        .string()
        .optional()
        .describe("Instagram actor ID or PBIA id (from get_pbia). Optional."),
      video_id: z.string().optional().describe("From upload_video"),
      image_hash: z.string().optional().describe("From upload_image"),
      message: z.string().optional().describe("Primary text / body copy"),
      title: z.string().optional().describe("Headline for link_data"),
      link: z.string().url().optional().describe("Landing page URL (for link_data)"),
      call_to_action: z
        .record(z.unknown())
        .optional()
        .describe(
          "e.g. {type: 'SHOP_NOW', value: {link: 'https://...'}}",
        ),
      description: z.string().optional(),
      url_tags: z.string().optional().describe("UTM tracking params"),
      thumbnail_url: z.string().url().optional(),
    },
  • src/index.ts:47-52 (registration)
    Registration of creativeTools (which includes create_ad_creative) in the allTools array, then registered via server.registerTool() in the stdio entrypoint.
    const allTools: ToolDef[] = [
      ...accountTools,
      ...campaignTools,
      ...adsetTools,
      ...adTools,
      ...creativeTools,
  • src/http.ts:30-41 (registration)
    Registration of creativeTools (which includes create_ad_creative) in the allTools array, then registered via server.registerTool() in the HTTP entrypoint.
    const allTools: ToolDef[] = [
      ...accountTools,
      ...campaignTools,
      ...adsetTools,
      ...adTools,
      ...creativeTools,
      ...mediaTools,
      ...insightsTools,
      ...bulkTools,
      ...pageTools,
      ...adsLibraryTools,
    ];
  • Helper function toAdAccountPath used in the handler to normalize ad account IDs (ensures 'act_' prefix).
    function toAdAccountPath(idOrActId: string): string {
      return idOrActId.startsWith("act_") ? idOrActId : `act_${idOrActId}`;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, description carries full burden. It discloses write behavior, prerequisites (video_id, image_hash), critical constraint that image hashes are per-account, and Instagram placement condition. Lacks rate limits or error details but adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Five sentences, front-loaded with purpose, each sentence adds value. No redundancy, and the important note about image hashes is included without bloating.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers the main use case and key constraints well given 13 parameters and no output schema. Could mention return value (e.g., created creative ID) but not essential for selection; the description enables correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds significant meaning beyond schema: explains the two data type branches (video_data vs link_data), maps specific parameters to each, clarifies conditional use of instagram_user_id, and notes image hash scope. Schema coverage is 77%, but description compensates richly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it creates a single-text ad creative from an object_story_spec, distinguishes from sibling create_ad_creative_with_asset_feed, and explicitly marks it as a WRITE operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides clear conditions for when to use: pass page_id plus ONE of video_data or link_data, and instagram_user_id if page not linked to Instagram. Does not explicitly exclude the asset feed sibling but the context implies this is for single-text creatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Mike25app/scaleforge-mcp-meta-ads'

If you have feedback or need assistance with the MCP directory API, please join our Discord server