Skip to main content
Glama
Mike25app

scaleforge-mcp-meta-ads

create_adset

Create a new ad set under a campaign. Define targeting, optimization goal, billing event, and budget. Ad set is paused by default. Enable dynamic creative for multi-text formats.

Instructions

WRITE: Create an ad set under a campaign. Default status is PAUSED. targeting is a Meta targeting spec object (geo_locations, age_min, age_max, interests, etc.). bid_amount is in account currency minor units (cents). For multi-text / dynamic creative ads you MUST set is_dynamic_creative=true — otherwise asset_feed_spec ads will be rejected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_account_idYes'act_123' or '123'
campaign_idYes
nameYes
targetingYesMeta targeting spec object (JSON)
optimization_goalYese.g. OFFSITE_CONVERSIONS
billing_eventYes
bid_amountNoBid in minor currency units (cents). Always set at adset level.
daily_budgetNoFor ABO; omit under CBO
lifetime_budgetNo
start_timeNoISO 8601, e.g. '2026-01-15T00:00:00+0000'
end_timeNo
statusNo
is_dynamic_creativeNoMust be true for asset_feed_spec / multi-text creatives
promoted_objectNoe.g. {pixel_id: 'XXX', custom_event_type: 'PURCHASE'} for conversion optimization
pacing_typeNoe.g. ['standard'] or ['no_pacing']

Implementation Reference

  • The async handler function that executes the create_adset tool logic. It constructs a body with required fields (campaign_id, name, targeting, optimization_goal, billing_event, status defaulting to PAUSED), conditionally adds optional fields (bid_amount, daily_budget, lifetime_budget, start_time, end_time, is_dynamic_creative, promoted_object, pacing_type), and POSTs to /{ad_account_id}/adsets via metaPost.
      handler: async (args) => {
        const body: Record<string, unknown> = {
          campaign_id: args.campaign_id,
          name: args.name,
          targeting: args.targeting,
          optimization_goal: args.optimization_goal,
          billing_event: args.billing_event,
          status: args.status ?? "PAUSED",
        };
        if (args.bid_amount !== undefined) body.bid_amount = args.bid_amount;
        if (args.daily_budget !== undefined) body.daily_budget = args.daily_budget;
        if (args.lifetime_budget !== undefined) body.lifetime_budget = args.lifetime_budget;
        if (args.start_time) body.start_time = args.start_time;
        if (args.end_time) body.end_time = args.end_time;
        if (args.is_dynamic_creative !== undefined)
          body.is_dynamic_creative = args.is_dynamic_creative;
        if (args.promoted_object) body.promoted_object = args.promoted_object;
        if (args.pacing_type) body.pacing_type = args.pacing_type;
        return metaPost(
          `/${toAdAccountPath(String(args.ad_account_id))}/adsets`,
          body,
        );
      },
    },
  • The inputSchema for create_adset, using Zod validators. Defines required fields (ad_account_id, campaign_id, name, targeting, optimization_goal, billing_event) and optional fields (bid_amount, daily_budget, lifetime_budget, start_time, end_time, status, is_dynamic_creative, promoted_object, pacing_type). References OPTIMIZATION_GOAL and BILLING_EVENT enum schemas.
    inputSchema: {
      ad_account_id: z.string().describe("'act_123' or '123'"),
      campaign_id: z.string(),
      name: z.string().min(1),
      targeting: z.record(z.unknown()).describe("Meta targeting spec object (JSON)"),
      optimization_goal: OPTIMIZATION_GOAL.describe("e.g. OFFSITE_CONVERSIONS"),
      billing_event: BILLING_EVENT,
      bid_amount: z
        .number()
        .int()
        .positive()
        .optional()
        .describe("Bid in minor currency units (cents). Always set at adset level."),
      daily_budget: z
        .number()
        .int()
        .positive()
        .optional()
        .describe("For ABO; omit under CBO"),
      lifetime_budget: z.number().int().positive().optional(),
      start_time: z
        .string()
        .optional()
        .describe("ISO 8601, e.g. '2026-01-15T00:00:00+0000'"),
      end_time: z.string().optional(),
      status: STATUS.optional(),
      is_dynamic_creative: z
        .boolean()
        .optional()
        .describe("Must be true for asset_feed_spec / multi-text creatives"),
      promoted_object: z
        .record(z.unknown())
        .optional()
        .describe(
          "e.g. {pixel_id: 'XXX', custom_event_type: 'PURCHASE'} for conversion optimization",
        ),
      pacing_type: z
        .array(z.string())
        .optional()
        .describe("e.g. ['standard'] or ['no_pacing']"),
    },
  • The OPTIMIZATION_GOAL Zod enum schema used by create_adset's inputSchema, defining valid optimization goals like NONE, LINK_CLICKS, OFFSITE_CONVERSIONS, etc.
    const OPTIMIZATION_GOAL = z.enum([
      "NONE",
      "LINK_CLICKS",
      "IMPRESSIONS",
      "REACH",
      "OFFSITE_CONVERSIONS",
      "LEAD_GENERATION",
      "LANDING_PAGE_VIEWS",
      "THRUPLAY",
      "VIDEO_VIEWS",
      "APP_INSTALLS",
      "POST_ENGAGEMENT",
      "QUALITY_LEAD",
      "VALUE",
    ]);
  • The BILLING_EVENT Zod enum schema used by create_adset's inputSchema, defining valid billing events (IMPRESSIONS, LINK_CLICKS, THRUPLAY, POST_ENGAGEMENT, APP_INSTALLS).
    const BILLING_EVENT = z.enum([
      "IMPRESSIONS",
      "LINK_CLICKS",
      "THRUPLAY",
      "POST_ENGAGEMENT",
      "APP_INSTALLS",
    ]);
  • src/index.ts:47-57 (registration)
    The create_adset tool is registered via the adsetTools array which is spread into allTools and then each tool is registered via server.registerTool() with its name, description, inputSchema, and handler.
    const allTools: ToolDef[] = [
      ...accountTools,
      ...campaignTools,
      ...adsetTools,
      ...adTools,
      ...creativeTools,
      ...mediaTools,
      ...insightsTools,
      ...bulkTools,
      ...pageTools,
      ...adsLibraryTools,
Behavior4/5

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

Discloses default status (PAUSED), field semantics (targeting is Meta spec, bid_amount in cents), and conditional behavior (is_dynamic_creative required for multi-text). No annotations provided, so description carries the burden; covers key behaviors well.

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?

Three sentences, zero waste. Front-loaded with purpose and default status, then field explanations, then critical constraint. Each sentence earns its place.

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 purpose, default behavior, key field semantics, and a crucial constraint. No output schema, so return value is not explained, but for a create operation this is acceptable. Could mention what is returned (e.g., ad set ID) for completeness.

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

Parameters4/5

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

Adds value beyond the input schema for targeting (explains it includes geo_locations, interests, etc.), bid_amount (minor units), and is_dynamic_creative (must be true for multi-text). Schema coverage is 60%, but description fills gaps for important parameters.

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?

Description starts with 'WRITE: Create an ad set under a campaign', clearly stating the verb and resource. It distinguishes from siblings like 'update_adset' by focusing on creation and adding specific details like default status and field semantics.

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 guidance on when to use (create ad sets) and includes important constraints (e.g., is_dynamic_creative must be true for multi-text ads). Does not explicitly mention when not to use or contrast with update_adset, but the context of sibling tool names makes it adequate.

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