/sparkx-ai-mcp:sparkx-manage-sa-labelsfrom sparkx-ai-mcp
Creates, reads, edits, and deletes Amazon SA labels, and manages their associations with campaigns, keywords, and ASINs. Covers label CRUD, permissions, rules, scheduling, and resource attachment.
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.
A label is a named tag bound to one or more shops. It can be attached to three kinds of thing - campaigns, keywords and products (ASINs) - and labels nest two levels only: a root and its direct children.
Five tools, all behind the amazon_sa_label:write scope, including the two read ones.
There is no read-only label scope, so "I cannot find the label tools" usually means the token
lacks that scope rather than the feature being off.
The scope is not permission on a label. It only decides whether the tools can be called. Each label is checked again on its own, and the read and write gates differ:
| Read, through the label tools | Write | |
|---|---|---|
| the label's own permission | must be readable | must be writable - otherwise 403 Write permission is required for label <id> |
| the label's shops | any of them within your authorized shops is enough | every shop the label belongs to must be covered |
So a label you can see through one shop is not necessarily one you can edit: pass all of its
shops, and expect a refusal when the label's own permission does not grant you write. Writable
means ADMIN_PERMISSION or WRITE_PERMISSION on that label, which a collaborative label can
perfectly well give you - "someone else created it" is not the test. Listing a label never
implies you may delete it.
A label you cannot reach at all comes back as 403 with errorCode: LABEL_NOT_VISIBLE, and
a fixed message: Label is unavailable in the requested scope. Use query_labels with action=search to find a label you can access in the selected shops. Do what it says - search within the shops
the user actually selected - rather than retrying the same id. It is a scope answer, not proof
the label was deleted.
The campaignLabel / keywordLabel filter on get_entity_metadata uses the stricter rule.
It is a read, but it checks the label the way a write does: every shop the label belongs to
must be inside your authorized shops, or the call is refused. A label you can list through the
label tools can still be unusable as a metadata filter.
| Tool | Does | Writes |
|---|---|---|
query_labels | search (default), find_by_name, detail, auto_names | no |
query_label_resources | what is attached to a label (items / count), or which labels a resource carries | no |
save_labels | create, update, move | yes |
manage_label_resources | add, remove, update associations | yes |
delete_labels | delete 1-20 labels with their children and associations | yes |
Call get_user_authorized_context first. profileIds is 1-200 positive authorized ids on every
tool; an unauthorized id is rejected (profileIds must contain 1 to 200 positive authorized profile IDs).
No performance by label. get_ads_perf has no label dimension at all - you cannot
select or group by one. "How did the campaigns under this label do" is three steps:
query_labels for the label id.get_entity_metadata, entity: campaign, filters.campaignLabel, and a select that
includes amazonCampaignId. That call has its own limits - page size 200, a two-key
ordering whitelist, and a skipped metadata lookup - see
sparkx-query-entity-metadata.get_ads_perf filtered to those campaigns.Step 3 needs the other id. Metadata rows carry the internal campaignId; get_ads_perf's
campaign.campaignId_ is the Amazon id. Passing the internal one is a valid filter that
matches nothing, so you get 0 rows and no error - which reads like "the label has no
campaigns". Take amazonCampaignId from step 2. The reverse direction wants the opposite:
query_label_resources campaigns takes the internal id, so when the user only has an
Amazon id, filter metadata on amazonCampaignId and read the internal one off the row.
If step 2 returns no campaigns, stop and say so. Never drop the label filter and report whole-store performance as if it were the label's.
Not a keyword list. A keyword list is a reusable bag of words referenced by id from a campaign or managed group; a label is a tag attached to objects that already exist. "Build me a list of these words" is sparkx-manage-keyword-list.
No editing of the labelled object. Attaching a label never changes a campaign, keyword or ASIN. Bids, budgets and states stay with sparkx-edit-ads.
labelType | What attaches resources | Created with |
|---|---|---|
MANUAL | you do, by calling manage_label_resources | create.labelType omitted or MANUAL |
RULE | a saved rule re-evaluated by the platform | create.labelType=RULE + create.rules |
AUTO | the platform extracts names out of campaign names on a schedule | create.labelType=AUTO + create.autoAssociation + explicitAutomaticRequest=true |
Default to MANUAL. Choose RULE or AUTO only when the user asks for it in so many
words - both keep changing the label's contents after you walk away.
A fourth value, NORMAL_RULE, is not something you create: it describes a label that ended up
with both manual associations and an enabled rule. It matters only when filtering, and the
filter is not a partition - see references/queries.md.
PRIVATE, PUBLIC_READ, PUBLIC_COLLABORATIVE, set on create and changeable on update.
Changing permission or ownership needs administrator rights on the root label and affects
its children. So does changing a root's shops, and moving a child can change what it is
attached to.
query_labels
action=find_by_name (filters.name, the full name - it matches roots and children together
and returns each child's parent name).get_entity_metadata, entity: campaign, filtered on
amazonCampaignId or campaignName, and take the internal campaignId off the matched row.
Ask the user only when that resolves to more than one campaign, to none, or when you cannot
read metadata at all - the rest of this skill never needs that permission.references/queries.md for filters, paging and the two lookup
directions.Read references/writes.md before any write. The rules that bite:
batch_update_ads, these tools validate and
then execute. Confirm with the user in conversation before calling, especially for
delete_labels, which also removes direct children, their associations, and disables related
automatic schedules.Operation affects more than 200 labels; narrow the selection / Too many affected children; narrow the operation to at most 200 labels. Nothing is written. This is a hard limit, not a warning, and
it counts affected descendants, not the ids you passed.AUTO and RULE submission is not completion. The scheduled or background association
work finishes later; do not report the label as populated.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).Other plugins' skills for the same job