wc_get_product_attributes: list product attributes
Lists the shop's global attributes — the ones defined once under Products → Attributes and reusable across products.
Arguments
None.
Permissions
mcp:read and woocommerce:catalog:read, plus manage_woocommerce or edit_products.
What it returns
items, each with:
| Field | Meaning |
|---|---|
id |
The attribute ID, needed by wc_get_attribute_terms |
name |
The internal slug |
label |
The name shown in the admin and, usually, on the storefront |
type |
How values are chosen — typically select |
Both name and label are returned because they differ, and they are used in different places: label is what people recognise, name is what the data uses.
Global attributes only
WooCommerce has two kinds:
- Global — defined shop-wide, with their own term lists. These appear here.
- Custom — typed directly into a single product, with values that exist only on that product. These do not appear here.
So an empty list does not mean the shop has no variable products. It means none of them use global attributes. To see what a specific product actually declares, read the product itself with wc_get_product, whose full response includes its attributes.
Confusing the two is the usual cause of variations that never become selectable.
It is step one of any variation work
The IDs here unlock the term lists, and the terms are what variations are built from. The order is fixed:
- This tool — which attributes exist.
wc_get_attribute_terms— which values each one offers.wc_set_product_attributes— attach them to the product.wc_create_variation— one per combination.
Skipping to step four is how you get variations nobody can buy.
No term counts, no products
The listing says which attributes exist, not how much they are used. It does not tell you how many terms an attribute has, or which products use it.
For the terms, call the next tool. For usage, there is no MCP tool — check the admin.
Using it well
List the shop's global attributes with their IDs and labels.
Before creating one:
List the attributes and tell me whether anything like "Material" already exists.
That check matters: duplicate attributes with near-identical labels are messy to unpick later, and wc_create_product_attribute will happily create the second one.
Common problems
| Symptom | Cause |
|---|---|
| The tool is missing | WooCommerce is not active |
pom_ai_mcp_wc_forbidden |
Missing shop capability |
| An empty list | No global attributes; products may still use custom ones |
| An attribute you expected is absent | It is a per-product custom attribute |
name and label differ |
Expected; one is the slug, the other the display name |
Related
wc_get_attribute_terms— next stepwc_create_product_attributewc_get_store_stats— includes an attribute count