/sparkx-ai-mcp:sparkx-create-campaignfrom sparkx-ai-mcp
Creates Amazon Sponsored Products, Sponsored Brands, and Sponsored Display campaigns in bulk, adds ad groups to existing campaigns, and creates advertising portfolios. Supports auto targeting, keywords, product targets, SD audience targeting, placement adjustments, and optional AMC audience.
Ships in sparkx-ai-mcp. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Up to six tools, all on scope amazon_sa_campaign_create:write, separate from the edit scope -
a token that can edit campaigns cannot necessarily create them.
| Tool | Creates | Read before building |
|---|---|---|
create_sp_sb_campaign | new SP or SB campaigns, with ad groups and children | sp-fields.md / create-sb-campaign.md |
create_sd_campaign | new SD campaigns, with ad groups, product ads, targets and an optional creative | create-sd-campaign.md |
create_sp_ad_group | ad groups under an existing SP campaign | create-sp-ad-group.md |
create_sb_ad_group | ad groups under an existing SB campaign | create-sb-ad-group.md |
create_sd_ad_group | ad groups under an existing SD campaign | create-sd-ad-group.md |
create_portfolio | one portfolio | create-portfolio.md |
Read your own tool list before promising anything. Each ad type can be turned on or off per deployment, and the tools follow:
create_sd_campaign, create_sb_ad_group and create_sd_ad_group are not registered at
all when their type is off - they simply will not be in your tool list. Do not go looking
for them, and do not tell the user a tool exists because this document names it.create_sp_sb_campaign, so a disabled type cannot be hidden that way:
it is refused at the entry with an error that lists the enabled types. Do not retry the
same type after that error; tell the user that type is not available here and point them at
the web console.This is the difference that decides how you recover from a failure, and it is easy to get backwards.
| Tool | On failure |
|---|---|
create_sp_sb_campaign | Fully atomic. Any failure anywhere and nothing is created. Fix and resend the whole batch; never "retry the rest" |
create_sd_campaign | Campaigns, ad groups, product ads and targets are one transaction - all or nothing. Creatives are attached afterwards and are NOT rolled back with it: the call still reports success and lists the failures in result.creativeFailures. You cannot retry those creatives through MCP - report them and send the user to the console; never re-run the batch |
create_sp_ad_group, create_sb_ad_group, create_sd_ad_group | Not atomic. Ad groups are created one at a time in request order; the ones already created stay. Expect partial_success and retry only the failed items |
create_portfolio | One portfolio, not idempotent. On any failure a local record may already exist - query by profile and name before retrying |
An "unconfirmed" result is not a failure. When an ad-group call times out or the downstream
errors in a way that leaves the outcome unknown, the tool stops, tells you which items are
confirmed created, and says the rest are unconfirmed. Never retry those blindly - call
get_entity_metadata(entity='adGroup', filters.campaignId=<campaignId>) first and retry only
what is genuinely missing.
The remaining sections describe the SP path unless they say otherwise; each other ad type has its own reference file in the table above.
A created campaign or ad group is live configuration. There is no "draft" state and no undo
through these tools - a mistake has to be cleaned up in sparkx-edit-ads or the console, one
object at a time.
Use state: "paused" while testing. A paused campaign or ad group can be enabled in one
edit afterwards. Creating enabled and fixing later can spend during the gap.
A create_sp_sb_campaign batch is atomic. If any campaign, ad group or child object fails validation or
the downstream write, nothing is created - not even the campaigns that were fine. So a
failure is safe, and the fix is to correct and resend the whole batch, never to "retry the
rest".
get_user_authorized_context -> the profileId. One profile per call; campaigns for
two stores are two calls.
get_entity_metadata(entity='asin') -> the ASINs you will promote, and their SKUs on a
Seller profile. Do not invent SKUs; see "Seller vs Vendor" below.
An ASIN that returns nothing may be a parent - see "A parent ASIN cannot be advertised"
below before telling the user it doesn't exist.
If the user asked for keyword or product-target suggestions, the suggestion entities live
in sparkx-query-entity-metadata. All of them need exactly one profileId, but their
mandatory filters differ - they are not interchangeable:
| Entity | Mandatory filter |
|---|---|
suggestedKeyword, keywordGroup, suggestedTarget | filters.asin |
suggestedBid | filters.asin, plus one of two mutually exclusive modes |
amcAudience | filters.campaignType (sponsoredProducts / sponsoredBrands / sponsoredDisplay). It takes no asin. What you do with the result differs by type - see below |
For new campaign creation, picking an audience is its own step, not part of the
suggestion sweep. create_sp_ad_group has no audience fields.
An AMC audience is wired in completely differently on SP/SB and on SD - the same
amcAudience ids, two unrelated mechanisms. Do not carry one shape to the other:
| SP / SB | SD | |
|---|---|---|
| Where it goes | three campaign-level fields | one target inside an ad group |
| What you send | audienceId + audienceSegmentType + audienceBidPercentage - all three together or none | a T00030 target whose expression is [{"type":"audience","value":[{"type":"audienceSameAs","value":"<audienceId>"}]}] |
| What it does | a bid uplift on an audience the campaign also targets otherwise | it is the targeting |
| Needs | create_sp_sb_campaign | create_sd_campaign with tactic: "T00030" |
On SD, also keep amcAudience apart from sdAudience: the latter is Amazon's own SD
audience catalog, a different pool, and an id from one is invalid in the other. Both are
used the same way once chosen - as an audienceSameAs value under T00030.
amcAudience also takes filters.audienceSegmentType, and that filter chooses which of
the two pools you see. Omitting it does not widen the search - it silently narrows it to
SPONSORED_ADS_AMC, so every Amazon-built audience is invisible and the user never learns
it existed. The filter takes one value only - a two-value array is rejected outright
(accepts a single value only, got 2), so there is no single call that returns both
pools. When the user names the type, query that pool. When they do not, either ask, or
make two separate calls - one with SPONSORED_ADS_AMC, one with BEHAVIOR_DYNAMIC -
and merge the two results into one list for them to choose from, saying which pool each
came from. Never let the default pick the audience.
Decide the targeting type before writing anything - the campaign's and the ad group's together. They decide which child lists are legal, and sending the wrong ones fails the batch.
The console shows one 投放类型 / Targeting radio on the campaign, but the request carries a
second targetingType on each ad group, and the two must agree.
A campaign is targetingType: "auto" or "manual", and an ad group is
targetingType: "keyword" or "target" (omitted on a manual campaign: inferred from content - only keywords -> keyword, only targets -> target, both or neither rejected). Only three combinations exist:
| What the user wants | campaign | ad group | Child lists you may send |
|---|---|---|---|
| let Amazon match automatically | auto | target (required) | targetBid and productAds; negatives of both kinds allowed |
| bid on search terms | manual | keyword | keywords + productAds; negativeKeywords only |
| target ASINs or categories | manual | target | targets + productAds; negativeTargets only |
Two things fall out of this table that are easy to get wrong:
target, not auto. Sending
targetingType: "auto" on the ad group is rejected.keyword ad group must not carry negativeTargets, and a target ad group must not carry
negativeKeywords. Auto campaigns accept both kinds. This mirrors the console, where the
two panels are mutually exclusive.The non-selected lists must be empty, not omitted-and-hoped-for: sending keywords on an
auto campaign fails the batch.
1. On create_sp_sb_campaign, biddingStrategy is required and has no default. SP accepts legacyForSales,
autoForSales or manual. Omitting it stores an empty strategy, so pick one explicitly and
say which one you picked.
2. An auto campaign must cover all four target groups. targetBid needs closeMatch,
looseMatch, substitutes and complements, each at most once. To disable one, send a
negative bid - do not omit it. An omitted group is a validation failure, not a default.
3. Keywords are unique per (keywordText, matchType) inside an ad group. A repeat is
rejected, not silently de-duplicated - the downstream would otherwise create two rows with
different bids. Deduplicate before sending.
4. On a Seller profile every promoted product needs sku, and the pair is verified; on a
Vendor profile sku must be omitted. See "Seller vs Vendor".
5. Budget-vs-bid validation differs by tool. create_sp_sb_campaign checks every
defaultBid / targetBid / keyword bid / target bid against the campaign budget; a negative
auto-targeting bid is exempt. create_sp_ad_group checks defaultBid against the existing
campaign budget when that budget can be read; do not claim that its child bids received the
same budget-cap check.
6. On create_sp_sb_campaign, siteRestrictions makes several other fields illegal. Its only value is
AMAZON_BUSINESS, it exists only on US/CA/MX/UK/DE/FR/IT/ES/IN/JP, and when you set it you
must omit siteAmazonBusinessAdjustment, every audience* field, and
offAmazonBudgetControlStrategy. Amazon rejects those combinations and the downstream would
drop them silently. Note the tool does not fill in the usual
offAmazonBudgetControlStrategy default when siteRestrictions is set, precisely so the
request matches what actually takes effect.
7. On JP profiles every bid and budget must be a whole number. No decimals anywhere.
| Seller | Vendor | |
|---|---|---|
| Product ad identity | ASIN + SKU | ASIN alone |
sku on productAds | required | must be omitted - a non-blank sku rejects the whole call |
| Verification | each (asin, sku) pair is checked against the shop's catalog, plus SP eligibility | SP eligibility only |
On a Seller profile a pair that is not found is rejected. Read SKUs from
get_entity_metadata(entity='asin') - never construct one.
On a Vendor profile send asin only. A non-blank sku rejects the whole call (nothing is
created): the downstream would send that SKU to Amazon instead of the ASIN, and Amazon
identifies vendor products by ASIN. A blank sku is treated as omitted.
On both profile types a product whose asinSpEligibilityStatus is INELIGIBLE rejects the
whole call (nothing is created); check it via get_entity_metadata(entity='asin') first.
⚠️ If the catalog lookup itself fails, the call is rejected too (nothing is created). That error means retry, not change the ASIN. Resending a different ASIN because a lookup failed is how you end up advertising the wrong product.
get_entity_metadata(entity='asin') lists advertisable products, and a parent ASIN is not
one of them: Amazon advertises the child (variation) ASINs, never the parent. So a user who
hands you a parent gets an empty lookup, which reads as "this product doesn't exist" when it
actually means "this one can't be advertised, but its children can".
When {"asin": "<value>"} returns no rows, re-query by parent before concluding anything:
get_entity_metadata(entity='asin', filters={"parentAsin": "<the same value>"})
⚠️ Do not substitute silently. "Couldn't find it, so I advertised all its children" is a different campaign from the one the user asked for, and a parent can have many children. Expand, show, and let them choose - the preview is where they see what will actually be promoted.
⚠️ Do not decide parentage from the field alone. A standalone product with no variations
comes back with parentAsin equal to its own asin. The only reliable test is the pair of
queries above: not found as asin, found as parentAsin.
This is a lookup detail, not a reason to change the product. The "lookup failure means retry, not a different ASIN" rule above still applies.
Three fields, one atomic group. Configuring an audience means sending audienceId,
audienceSegmentType and audienceBidPercentage together, or none of them.
audienceBidPercentage is an integer 0-900 sent as a string; audienceSegmentType is
SPONSORED_ADS_AMC or BEHAVIOR_DYNAMIC.
All three are enforced. An audienceId without an audienceBidPercentage is rejected,
and audienceSegmentType is required whenever audienceId is set - there is no default
to fall back on.
The server checks that the id really belongs to the pool you named. Before any campaign is
created it looks the audienceId up in the audience list for that profileId,
campaignType and audienceSegmentType. An id from the other pool, or one that no longer
appears in the list, is rejected; so is a lookup that fails or comes back empty. The check
covers the whole request, so one bad binding stops every campaign in the batch.
A wrong pool therefore fails loudly now rather than silently - but that does not make guessing
cheap, because the rejection costs the entire batch. Copy audienceId and
audienceSegmentType from one and the same get_entity_metadata(entity='amcAudience')
row - that entity echoes the type on every row exactly so the pair travels together.
Never substitute that query's default type for the campaign's real one:
SPONSORED_ADS_AMC is the default of the lookup, not a fact about the audience you picked.
There is no "audience off" flag here. To create without an audience, omit all three
fields. (audienceBidAdjustmentEnabled exists only on the edit path, for clearing a binding
that already exists.)
⚠️ A successful write still does not prove Amazon applied the binding. Validation confirms the id belongs to the pool, not that the targeting went live. Don't report it as confirmed on Amazon's side from the write response alone.
portfolioId wants the Amazon portfolio id, and it is verifiedThis is the one field where the usual rule inverts. Everywhere else a write takes the
internal id; here the tool checks the value against the shop's portfolios and requires
amazonPortfolioId - the long one from get_entity_metadata(entity='portfolio'), not the
much shorter same-named portfolioId in that response.
Sending the internal id fails with portfolioId must be an Amazon portfolio ID belonging to profile ..., which is a good error but an easy one to earn: the two fields differ only by
prefix. A portfolio belonging to another shop is rejected the same way.
Convert the type as you copy it. amazonPortfolioId comes back from
get_entity_metadata as a string; this request field is a number. Parse the digits
and send "portfolioId": 123456789012345, not "123456789012345".
The console's "Add from keyword list" (从词库添加) tab has an equivalent on
create_sp_sb_campaign, create_sp_ad_group and create_sb_ad_group: each ad group accepts
keywordLists and negativeKeywordLists (only when keyword list features are enabled on the
server; otherwise the call is rejected and you send the words explicitly).
keywordLists: keywordListIds (1-10), matchTypes (exact / phrase / broad), bid
(required) and optional state. negativeKeywordLists: keywordListIds and matchTypes
(negativeExact / negativePhrase) only - no bid, no state.get_keyword_list with profileIds=[profileId]. At most 10 distinct keyword
lists (词库) per call.keywords / negativeKeywords before any
other check, so the normal rules apply: keyword lists fit a keyword ad group, an SP auto
campaign takes only negativeKeywordLists, and every expanded keyword must pass the bid rules
and the 1000-per-list / 5000-total limits. Over a limit the call is rejected, not truncated./ are skipped too.get_keyword_list (keywordListId, include=['keywords']). After the write,
data.keywordListExpansion reports per ad group how many entries were added and skipped.The user may be looking at the creation page while talking to you. These parts of it have no equivalent here - say so and point at the console rather than approximating:
targetBid; there is no "just use the default" mode. If the user wants
a single bid, send the same value four times and tell them that is what you did.create_sp_ad_group / create_sb_ad_group / create_sd_ad_group) and they
are not interchangeable - create_sp_ad_group rejects a campaign that is not
sponsoredProducts. If the tool for that type is not in your list, use the console.Terminology for everything the tool does support is mapped to the console's own labels in
references/sp-fields.md - use those labels when you talk to the
user.
| Limit | Value |
|---|---|
| campaigns per call | 20 |
| ad groups per campaign | 50 |
| items in any one child list | 1000 |
| child items across the whole call | 5000 |
Split larger campaign-creation workloads into several calls. Each
create_sp_sb_campaign call is its own atomic unit, so report per call which ones landed.
Those four limits apply to create_sd_campaign as well, counting its productAds and
targets lists.
All three ad-group tools cap at 10 ad groups per call, and all three are deliberately
non-atomic: they create rows sequentially and may return partial_success. Read that
tool's reference file before building or recovering the request.
1. get_user_authorized_context -> profileId (one per call)
2. get_entity_metadata(entity='asin') -> ASINs, and SKUs on a Seller profile
3. (optional) suggestion entities -> keywords / targets / bids / audiences
4. Route the request by what is being created and the ad type:
new SP/SB campaign -> `create_sp_sb_campaign`; new SD campaign -> `create_sd_campaign`;
ad groups under an existing campaign -> `create_sp_ad_group` / `create_sb_ad_group` /
`create_sd_ad_group` matching that campaign's type; a portfolio -> `create_portfolio`.
For SB and SD, collect the ids those tools need first - brand entity, store page, page
ASINs, creative assets, SD audiences - all of which live in `sparkx-query-entity-metadata`
under "entities that exist for SB and SD creation".
5. Decide the required targeting type(s). Ambiguous -> ASK, do not pick.
6. Build the request and check that tool's limits.
7. Show the user what will be created and get a yes.
8. Call the selected create tool.
9. Read back the created campaign/ad groups. On an ambiguous ad-group result, read back
before retrying and retry only entries proven missing.
Step 7 is not optional. This is a write that can start spending.
Step 9 matters more than usual here: success means the objects were created locally.
create_sp_sb_campaign returns only campaign ids; create_sp_ad_group returns per-item
results, but neither response proves Amazon synchronization or delivery.
After create_sp_sb_campaign or create_sd_campaign, wait a short while (a large batch can
take several minutes) and read the campaigns back with
get_entity_metadata(profileIds=[<request.profileId>], entity='campaign', userContext='Verify Amazon campaign sync after creation', filters={"campaignId": {"in": <result.campaignIds>}}, select=["campaignId","campaignName","syncStatus","syncDesc"]). Use these exact field names
syncStatus and syncDesc in select and when reading the returned rows. syncStatus is 0 while the
push to Amazon is running, 1 once the campaign exists on Amazon, and 2 if the sync failed.
Report the count per syncStatus and use syncDesc to explain failures. An explicit Amazon rejection
confirms the campaign was rejected. A timeout or response parsing error leaves the Amazon result
unconfirmed. Verify the outcome before recreating the campaign.
Amazon allows an advertiser account at most 10,000 non-archived campaigns, counted across all
marketplaces and ad types. Past that, Amazon rejects the rest with number of non archived campaigns exceeds the limit per advertiser. Do not retry: tell the user to archive campaigns
they no longer use, or to ask Amazon to raise the limit.
Show, in the user's own terms: whether this creates a campaign or adds ad groups to an existing one; the campaign and ad-group names; budget/start/bidding settings when creating a campaign; targeting, ASINs, and enabled/paused state. Then get a yes.
If the user has explicitly waived confirmation, announce the same summary and proceed without
waiting - see the waiver rules in sparkx-edit-ads. A waiver for editing does not authorize
creating: it has to cover creation.
The response gives internal ids, not Amazon ids. Creation completes locally first and the Amazon id appears later, after sync. So:
Full convention: references/platform-notes.md -> "Naming
things in your answer".
targetingTypes and cannot be converted afterwards through this tool.paused. Say that you did.manualCollection, storeSpotlight, video and brandVideo need
different assets and look completely different. Ask which one; do not pick whichever is
easiest to assemble from what you already have.T00020 is product / category targeting, T00030 is audience targeting.
They take completely different target expressions and cannot be swapped afterwards here.autoCollection or
productCollection creative on create_sb_ad_group, an SD ad group created paused - say so
and point at the console. Do not approximate it with something else.| File | Read it when |
|---|---|
references/sp-fields.md | Creating a new SP campaign with create_sp_sb_campaign; campaign fields and shared SP labels |
references/create-sb-campaign.md | Creating a new SB campaign with create_sp_sb_campaign; creatives, landing pages, SB-only field rules |
references/create-sd-campaign.md | Creating a new SD campaign with create_sd_campaign; tactics, target expressions, the creative second step |
references/create-sp-ad-group.md | Adding ad groups to an existing SP campaign; non-atomic results and recovery |
references/create-sb-ad-group.md | Adding ad groups to an existing SB campaign |
references/create-sd-ad-group.md | Adding ad groups to an existing SD campaign |
references/create-portfolio.md | Creating a portfolio with create_portfolio |
references/platform-notes.md | Auth, envelope, errors, and how to name things in your answer |
Sibling skills you will need installed: sparkx-query-entity-metadata (ASINs, SKUs,
portfolios, suggestions), sparkx-edit-ads (anything after creation).
references/create-portfolio.md (opens in a new tab)references/create-sb-ad-group.md (opens in a new tab)references/create-sb-campaign.md (opens in a new tab)references/create-sd-ad-group.md (opens in a new tab)references/create-sd-campaign.md (opens in a new tab)references/create-sp-ad-group.md (opens in a new tab)references/platform-notes.md (opens in a new tab)references/sp-fields.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub sparkxai/sparkxai-mcp --plugin sparkx-ai-mcp23 skills in this plugin
/sparkx-ads-structure-analysisAnalyze how ad spend and efficiency break down across a structural dimension — campaign type (SP/SB/SD), marketplace/site, portfolio, weekday-vs-weekend, hour-of-day, or campaign size tiers (head vs long tail) — and diagnose where spend share and efficiency don't match (over-invested underperformers, under-invested strong performers). Optional sub-scenarios: SP deep-dive (manual vs auto targeting), SB new-to-brand focus. Use when the user asks "我 SP/SB/SD 结构合理吗", "各站点谁强", "SB 新客到底行不行", "工作日和周末哪个好", "structure analysis", "campaign type breakdown". Not for a single-entity trend/anomaly check (use sparkx-weekly-ads-report / sparkx-monthly-ads-report / a lighter ad-hoc analysis skill), product-level diagnosis (use sparkx-product-diagnosis), or search-term diagnosis (use sparkx-search-term-diagnosis)./sparkx-ai-managed-auditAudit AI managed groups (托管组) against a stated success standard: grade every managed campaign 卓越/优秀/良好/一般/差 by the group's objective, pull out the 差 ones, and recommend what to change in the group's configuration — split the group, objective, target ACOS, AI personality, action space, review cadence. Use when the user asks "AI 托管到底有没有效果", "哪些托管组没做好", "给我出份 AI 托管组诊断/评级/审核/POP 报告", "按我们的成功标准给广告活动评级", "AI managed group audit", "grade my managed campaigns". Not for descriptive performance recaps without a grading standard (use sparkx-weekly-ads-report / sparkx-monthly-ads-report), not for ASIN-level or keyword-level diagnosis (use sparkx-product-diagnosis), and never for applying changes (use sparkx-edit-ai-group / sparkx-edit-ads)./sparkx-asin-deep-diveDiagnose one named ASIN or parent ASIN: why sales fell or ACOS rose, where traffic comes from, whether its ad structure is fragmented, and which variants deserve budget. Combine account ad data with SQP / ABA demand and share, limited competitorProduct data and brand peer benchmarks; use the customer's SellerSprite for organic rank and broader category comparisons when available. Use for "这个 ASIN 为什么销售下滑 / ACOS 为什么高" or "哪个子体该留". Read-only recommendations. To find which products need diagnosis first, use sparkx-product-diagnosis; for search-term negatives or harvest decisions use sparkx-search-term-diagnosis. For store-, category- or brand-level SQP analysis use sparkx-sqp-insight./sparkx-category-scorecardCompare advertising performance and available brand peer ranges for one specified Amazon category or a confirmed set of ASINs. For a broad store request, start with the advertised products and propose a scope. Use when the user asks "我们这个类目跟同行比怎么样", "保健品的 ROAS 算好吗", "Collagen 的 ACOS 目标设多少合理", "这个类目表现到底好不好". Read-only; no whole-store category ranking, budget allocation, or advertising edit - 不出预算清单,也不改账户。/sparkx-create-ai-groupCreate a NEW AI managed group (托管组) for Amazon Sponsored ads and place campaigns under it when required. Routes by ad type - SD via create_sd_ai_managed_group (campaigns required); SP/SB via save_sp_sb_ai_managed_group (create mode). Use when the user wants to create / set up / 新建 / 建一个 a managed group, or put campaigns under AI management for the first time, even without the exact words "managed group". When the user isn't sure how to set the group up, recommends a matching platform template (推荐托管组模板) - optional, never forced. This creates the group itself - it is NOT for enabling or editing an existing group (use sparkx-edit-ai-group) or deleting one (use sparkx-delete-ai-group)./sparkx-delete-ai-groupDelete (archive) an AI managed group (托管组) itself - SD, SP, or SB - releasing its campaigns or migrating them to another group. Use when the user wants to delete / 删除 / 归档 a managed group (the group container) or wind one down. Destructive and irreversible. This archives the GROUP - it is NOT for removing a single campaign from a group (use sparkx-edit-ai-group), editing config (use sparkx-edit-ai-group), or creating a group (use sparkx-create-ai-group).Other plugins' skills for the same job