Skip to main content
Glama

WooCommerce: Create product attribute

woocommerce_create_product_attribute

Creates a global product attribute for a WooCommerce site so variable products can define variation options such as Size or Color.

Instructions

[UNIFIED] Create a new global product attribute for use in variable products. Attributes define variation options like Size or Color.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "site": "<site>",
      "name": "<name>"
    },
    "name": "woocommerce_create_product_attribute"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
siteYes
slugNo
typeNoselect
order_byNomenu_order
has_archivesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.14.0
  2. Removedv3.13.1
  3. First observedv3.4.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already disclose readOnlyHint=false and idempotentHint=false, so the agent knows this writes and is not idempotent. The description usefully adds the word "global", distinguishing store-wide attributes from product-level custom attributes, but it says nothing about slug uniqueness, what happens on a name collision, or what identifier is returned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, purpose front-loaded, with the second sentence earning its place as a definitional gloss. It is efficient, though the brevity is partly the cause of the missing parameter and behavioral detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter mutation tool with no output schema and zero schema description coverage, the description should carry substantially more weight than two sentences. An agent still cannot tell how `type` values are constrained, what `order_by` accepts, or what the created attribute's identity looks like.

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

Parameters2/5

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

Schema description coverage is 0% for six parameters, so the schema contributes only types and defaults. The description adds meaning only for `name` indirectly via the "Size or Color" example; it never explains `slug`, `type`, `order_by`, or `has_archives`, leaving four parameters semantically opaque.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb+resource ("Create a new global product attribute") and adds a clarifying gloss ("Attributes define variation options like Size or Color") that tells an agent what an attribute actually is. It distinguishes creation from the list/delete attribute siblings by verb alone, though it never names them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"For use in variable products" implies the context in which an attribute is needed, which is more than nothing. However, there is no explicit when-to-use/when-not guidance, no prerequisite about which store or permissions are required, and no pointer to woocommerce_list_product_attributes for checking existing attributes before creating a duplicate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools