Skip to main content
Glama

woo_update_coupon

Modify a WooCommerce coupon by sending only the fields you want to change, leaving all other coupon settings unchanged.

Instructions

Update a coupon; only the given fields change

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>",
      "id": "<id>"
    },
    "name": "woo_update_coupon"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesCoupon ID
codeNoCoupon code
siteYesSite id (see list_sites)
amountNoDiscount amount as decimal string (default "0")
product_idsNoProducts the coupon applies to
usage_limitNoTotal usage limit
date_expiresNoExpiry date (YYYY-MM-DD)
discount_typeNoDiscount type (default fixed_cart)
free_shippingNoGrants free shipping (default false)
individual_useNoCannot be combined with other coupons (default false)
maximum_amountNoMaximum cart subtotal as decimal string
minimum_amountNoMinimum cart subtotal as decimal string
excluded_product_idsNoProducts the coupon does not apply to
usage_limit_per_userNoUsage limit per customer

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changedv3.14.0
    • addedInput schema / properties / amount / description
      Added value: +"Discount amount as decimal string (default \"0\")"
    • addedInput schema / properties / code / description
      Added value: +"Coupon code"
    • addedInput schema / properties / date_expires / description
      Added value: +"Expiry date (YYYY-MM-DD)"
    • addedInput schema / properties / discount_type / description
      Added value: +"Discount type (default fixed_cart)"
    • addedInput schema / properties / discount_type / enum
      Added value: +[
      +  "fixed_cart",
      +  "percent",
      +  "fixed_product"
      +]
    • addedInput schema / properties / excluded_product_ids / description
      Added value: +"Products the coupon does not apply to"
    • changedInput schema / properties / excluded_product_ids / items / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / free_shipping / description
      Added value: +"Grants free shipping (default false)"
    • changedInput schema / properties / id / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / individual_use / description
      Added value: +"Cannot be combined with other coupons (default false)"
    • addedInput schema / properties / maximum_amount / description
      Added value: +"Maximum cart subtotal as decimal string"
    • addedInput schema / properties / minimum_amount / description
      Added value: +"Minimum cart subtotal as decimal string"
    • addedInput schema / properties / product_ids / description
      Added value: +"Products the coupon applies to"
    • changedInput schema / properties / product_ids / items / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / usage_limit / description
      Added value: +"Total usage limit"
    • changedInput schema / properties / usage_limit / type
      Previous value: -"number"New value: +"integer"
    • addedInput schema / properties / usage_limit_per_user / description
      Added value: +"Usage limit per customer"
    • changedInput schema / properties / usage_limit_per_user / type
      Previous value: -"number"New value: +"integer"
  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: -[
      -  "id"
      -]New value: +[
      +  "site",
      +  "id"
      +]
  3. First observedv2.0.0

TDQS

B3.1/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, and it does disclose the single most important behavioral trait: omitted fields are left untouched. It says nothing, however, about permissions, whether changing the code invalidates existing redemptions, or whether usage counters are affected.

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?

One short sentence, front-loaded with the action and followed by the key behavioral qualifier; no filler. It is terse rather than padded, which fits the dimension even if it leaves gaps elsewhere.

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 14-parameter mutation tool with no annotations and no output schema, the description is thin: it omits required-parameter guidance (site, id), side effects of changing fields, and any confirmation of what is returned. The partial-update clause is helpful but insufficient at this complexity.

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 description coverage is 100%, including the enum for discount_type and format hints for dates and decimal strings, so the parameters are already well documented. The description adds no per-field meaning beyond the generic partial-update rule, which is the correct baseline expectation here.

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?

"Update a coupon" gives a specific verb and resource, and "only the given fields change" adds the partial-update semantics that distinguishes it from a full replace. It does not explicitly name the create/get/delete siblings, but the verb alone separates it from those alternatives.

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 statement of when to use this versus woo_create_coupon or woo_get_coupon, and no prerequisites such as needing an existing coupon ID or resolving the site first. The agent must infer the usage context entirely from the tool name.

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