Skip to main content
Glama

create_tiktok_campaign

Set up TikTok ad campaigns with targeting, ad copy, and budget in one call. Campaigns are created disabled for review before activation.

Instructions

Create a complete TikTok ad campaign in one call — campaign + ad group with targeting + ad. Created in DISABLE state. Call enable_tiktok_campaign to activate. TikTok minimum budget is $20/day. Requires Pro plan or higher ($69/mo).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesCampaign name.
objectiveNoObjective: TRAFFIC, LEAD_GENERATION, WEBSITE_CONVERSIONS, ENGAGEMENT, APP_PROMOTION. Default: TRAFFIC.
budget_usdYesDaily budget in USD. TikTok minimum: 20.
destination_urlYesLanding page URL (must include https://).
ad_textYesAd copy text. Keep it punchy — TikTok is a fast-scroll platform.
targeting_countriesNoCountry codes. Example: ["US"]. Default: ["US"].
age_groupsNoAge brackets: AGE_13_17, AGE_18_24, AGE_25_34, AGE_35_44, AGE_45_54, AGE_55_100. Default: [AGE_18_24, AGE_25_34].

Implementation Reference

  • The handler implementation for the create_tiktok_campaign tool.
    case 'create_tiktok_campaign': {
        const denied = licenseCheck('tiktok');
        if (denied) return fail(denied);
        if (!cfg.hasTikTok()) return fail('TikTok credentials not set.');
        if (!args.name || !args.budget_usd || !args.destination_url || !args.ad_text)
            return fail('Required: name, budget_usd, destination_url, ad_text');
    
        // Validate budget
        const budgetError = validateTikTokBudget(args.budget_usd);
        if (budgetError) return fail(budgetError);
    
        // Validate URL
        const urlError = validateUrl(args.destination_url);
        if (urlError) return fail(urlError);
    
        const campaignRes = await tikTokPost('/campaign/create/', {
            advertiser_id: cfg.tikTokAdvId(), campaign_name: args.name,
            objective_type: args.objective || 'TRAFFIC',
            budget_mode: 'BUDGET_MODE_DAY', budget: args.budget_usd, operation_status: 'DISABLE',
        });
        const campaignId = campaignRes.data?.campaign_id;
    
        const today = new Date().toISOString().split('T')[0].replace(/-/g, '');
        const adGroupRes = await tikTokPost('/adgroup/create/', {
            advertiser_id: cfg.tikTokAdvId(), campaign_id: campaignId,
            adgroup_name: `${args.name} — Group`, placement_type: 'PLACEMENT_TYPE_AUTOMATIC',
            location_ids: [2840], age: (args.age_groups as string[]) || ['AGE_18_24', 'AGE_25_34'],
            budget_mode: 'BUDGET_MODE_DAY', budget: args.budget_usd,
            schedule_type: 'SCHEDULE_START_END', schedule_start_time: `${today} 00:00:00`,
            schedule_end_time: '20380101 00:00:00', optimization_goal: 'CLICK',
            billing_event: 'CPC', operation_status: 'DISABLE',
        });
    
        const adRes = await tikTokPost('/ad/create/', {
            advertiser_id: cfg.tikTokAdvId(), adgroup_id: adGroupRes.data?.adgroup_id,
            ad_name: `${args.name} — Ad`, ad_text: args.ad_text,
            landing_page_url: args.destination_url, call_to_action: 'LEARN_MORE', operation_status: 'DISABLE',
        });
    
        return ok({
            success: true, status: 'DISABLE',
            next_step: 'Call enable_tiktok_campaign with campaign_id to start running.',
            campaign_id: campaignId, adgroup_id: adGroupRes.data?.adgroup_id, ad_id: adRes.data?.ad_id,
            budget_usd: args.budget_usd,
        });
    }
  • Tool registration and schema definition for create_tiktok_campaign.
        name: 'create_tiktok_campaign',
        description: 'Create a complete TikTok ad campaign in one call — campaign + ad group with targeting + ad. Created in DISABLE state. Call enable_tiktok_campaign to activate. TikTok minimum budget is $20/day. Requires Pro plan or higher ($69/mo).',
        inputSchema: {
            type: 'object',
            properties: {
                name:                { type: 'string',  description: 'Campaign name.' },
                objective:           { type: 'string',  description: 'Objective: TRAFFIC, LEAD_GENERATION, WEBSITE_CONVERSIONS, ENGAGEMENT, APP_PROMOTION. Default: TRAFFIC.' },
                budget_usd:          { type: 'number',  description: 'Daily budget in USD. TikTok minimum: 20.' },
                destination_url:     { type: 'string',  description: 'Landing page URL (must include https://).' },
                ad_text:             { type: 'string',  description: 'Ad copy text. Keep it punchy — TikTok is a fast-scroll platform.' },
                targeting_countries: { type: 'array',   items: { type: 'string' }, description: 'Country codes. Example: ["US"]. Default: ["US"].' },
                age_groups:          { type: 'array',   items: { type: 'string' }, description: 'Age brackets: AGE_13_17, AGE_18_24, AGE_25_34, AGE_35_44, AGE_45_54, AGE_55_100. Default: [AGE_18_24, AGE_25_34].' },
            },
            required: ['name', 'budget_usd', 'destination_url', 'ad_text'],
        },
    },
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: campaigns are created in DISABLE state, requires Pro plan or higher ($69/mo), and mentions TikTok minimum budget constraint. It doesn't cover error handling or response format, but provides substantial operational context.

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?

The description is perfectly front-loaded with the core functionality in the first clause, followed by important operational details. Every sentence adds critical information with zero waste - state, activation method, budget constraint, and plan requirement.

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?

For a creation tool with no annotations and no output schema, the description provides excellent context about the creation state, activation requirements, budget constraints, and plan prerequisites. It could mention what happens on success/failure or return format, but covers most critical operational aspects well.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description adds minimal parameter-specific information beyond reinforcing the TikTok minimum budget constraint. Baseline 3 is appropriate when schema does the heavy lifting.

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 the tool creates a complete TikTok ad campaign with campaign, ad group with targeting, and ad in one call. It specifies the resource (TikTok ad campaign) and distinguishes from siblings like create_meta_campaign by explicitly mentioning TikTok.

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?

The description provides clear context for when to use this tool (creating TikTok campaigns) and mentions the need to call enable_tiktok_campaign to activate. It doesn't explicitly state when not to use it or compare with alternatives like create_meta_campaign, but the TikTok-specific focus provides good guidance.

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/Nolas-Shadow/agent1st-ads-mcp'

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