Skip to main content
Glama

woo_create_variation

Create a product variation for a variable WooCommerce product using an attribute map plus optional SKU, pricing, and stock settings.

Instructions

Create a variation of a variable product. Note: wp-pilot-pro 1.1.0 declares attributes as a list and rejects this map with 400 until the plugin declares it as an object

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>",
      "product_id": "<product_id>",
      "attributes": "<attributes>"
    },
    "name": "woo_create_variation"
  }
}

Input Schema

NameRequiredDescriptionDefault
skuNoSKU (must be unique)
siteYesSite id (see list_sites)
attributesYesAttribute map, e.g. {"pa_color": "red", "size": "XL"} (key: attribute taxonomy or custom attribute name; value: term slug or option; "" = any)
product_idYesParent product ID
sale_priceNoSale price as decimal string
manage_stockNoTrack stock quantity (default false)
stock_statusNoStock status (default instock)
regular_priceNoRegular price as decimal string
stock_quantityNoStock quantity

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changedv3.14.0
    • addedInput schema / properties / attributes / additionalProperties
      Added value: +{
      +  "type": "string"
      +}
    • changedInput schema / properties / attributes / description
      Previous value: -"Variation attributes"New value: +"Attribute map, e.g. {\"pa_color\": \"red\", \"size\": \"XL\"} (key: attribute taxonomy or custom attribute name; value: term slug or option; \"\" = any)"
    • removedInput schema / properties / attributes / items
      Removed value: -{
      -  "additionalProperties": {
      -    "type": "string"
      -  },
      -  "type": "object"
      -}
    • changedInput schema / properties / attributes / type
      Previous value: -"array"New value: +"object"
    • removedInput schema / properties / manage_stock / default
      Removed value: -false
    • addedInput schema / properties / manage_stock / description
      Added value: +"Track stock quantity (default false)"
    • changedInput schema / properties / product_id / type
      Previous value: -"number"New value: +"integer"
    • removedInput schema / properties / regular_price / default
      Removed value: -""
    • addedInput schema / properties / regular_price / description
      Added value: +"Regular price as decimal string"
    • removedInput schema / properties / sale_price / default
      Removed value: -""
    • addedInput schema / properties / sale_price / description
      Added value: +"Sale price as decimal string"
    • removedInput schema / properties / sku / default
      Removed value: -""
    • addedInput schema / properties / sku / description
      Added value: +"SKU (must be unique)"
    • addedInput schema / properties / stock_quantity / description
      Added value: +"Stock quantity"
    • changedInput schema / properties / stock_quantity / type
      Previous value: -"number"New value: +"integer"
    • removedInput schema / properties / stock_status / default
      Removed value: -"instock"
    • addedInput schema / properties / stock_status / description
      Added value: +"Stock status (default instock)"
    • addedInput schema / properties / stock_status / enum
      Added value: +[
      +  "instock",
      +  "outofstock",
      +  "onbackorder"
      +]
  2. Changed2 schema fields changedv3.4.0
    • addedInput schema / properties / site
      Added value: +{
      +  "description": "Site id (see list_sites)",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "product_id",
      -  "attributes"
      -]New value: +[
      +  "site",
      +  "product_id",
      +  "attributes"
      +]
  3. First observedv2.0.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses a notable failure mode: a plugin-version quirk where `attributes` sent as a map is rejected with 400 until the server treats it as an object. That is real behavioral value. However, it doesn't cover other mutation behavior — whether duplicate SKUs/attribute combos fail, what permissions are required, or what the response contains.

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 sentences with zero filler; the purpose comes first and the caveat follows. The caveat is dense but earns its place by warning about a concrete 400 failure. Slightly cryptic versioning language keeps it from a 5.

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

Completeness3/5

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

For a 9-parameter mutation tool with a nested object and no annotations or output schema, the description covers the highest-risk parameter trap (attributes format) but leaves out preconditions and failure/response behavior. Given 100% schema coverage, that's adequate but with clear gaps.

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 coverage is 100%, so the baseline is 3. The description reinforces that `attributes` must be an object map rather than a list, which echoes and contextualizes the schema rather than adding new per-parameter detail. Nothing is said about sku, prices, or stock fields beyond what the schema already documents.

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?

States a specific verb and resource: 'Create a variation of a variable product.' The verb 'Create' clearly separates it from woo_update_variation and woo_delete_variation, and 'of a variable product' scopes it to the parent type. It does not explicitly name a sibling alternative, so it stops short of a 5.

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

Usage Guidelines2/5

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

There is no explicit when-to-use or when-not-to-use guidance, and no mention of the precondition that the parent product must be of type 'variable' (only implied by the noun phrase). The compatibility note about wp-pilot-pro is about a bug, not about tool selection, so it doesn't help choose between this and woo_update_variation.

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