Skip to main content
Glama

woo_create_coupon

Creates a WooCommerce coupon on a WordPress site by defining its code, discount amount/type, products, usage limits, and expiry date.

Instructions

Create a coupon

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>",
      "code": "<code>"
    },
    "name": "woo_create_coupon"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesCoupon 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. Changed22 schema fields changedv3.14.0
    • removedInput schema / properties / amount / default
      Removed value: -"0"
    • addedInput schema / properties / amount / description
      Added value: +"Discount amount as decimal string (default \"0\")"
    • removedInput schema / properties / discount_type / default
      Removed value: -"fixed_cart"
    • addedInput schema / properties / discount_type / description
      Added value: +"Discount type (default fixed_cart)"
    • removedInput schema / properties / excluded_product_ids / default
      Removed value: -[]
    • 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"
    • removedInput schema / properties / free_shipping / default
      Removed value: -false
    • addedInput schema / properties / free_shipping / description
      Added value: +"Grants free shipping (default false)"
    • removedInput schema / properties / individual_use / default
      Removed value: -false
    • addedInput schema / properties / individual_use / description
      Added value: +"Cannot be combined with other coupons (default false)"
    • removedInput schema / properties / maximum_amount / default
      Removed value: -""
    • addedInput schema / properties / maximum_amount / description
      Added value: +"Maximum cart subtotal as decimal string"
    • removedInput schema / properties / minimum_amount / default
      Removed value: -""
    • addedInput schema / properties / minimum_amount / description
      Added value: +"Minimum cart subtotal as decimal string"
    • removedInput schema / properties / product_ids / default
      Removed value: -[]
    • 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: -[
      -  "code"
      -]New value: +[
      +  "site",
      +  "code"
      +]
  3. First observedv2.0.0

TDQS

C2.2/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden, yet it discloses nothing about permissions required, whether required fields like site and code are validated, side effects, or error behavior. The single verb 'Create' at least signals a write operation, but nothing beyond that.

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

Conciseness3/5

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

The description is only three words, so it is certainly concise and front-loaded with the core verb. However, brevity here reflects under-specification rather than disciplined editing, leaving no structure to speak of.

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

Completeness1/5

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

A 13-parameter mutation tool with no annotations and no output schema needs far more than three words. Nothing tells the agent which parameters are required (site and code), what a successful response contains, or what constraints apply, making this definition inadequate for correct invocation.

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%, so every one of the 13 parameters is documented in the schema, including defaults and the discount_type enum. The description adds no parameter meaning beyond the schema, which is the baseline expectation when coverage is complete.

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

Purpose2/5

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

The description 'Create a coupon' merely restates the tool name (woo_create_coupon) and title. It does not distinguish this tool from the many sibling create/update/delete tools or convey what a coupon creation actually entails in this system.

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 guidance on when to use this tool versus alternatives such as woo_update_coupon or woo_create_product. The only implied usage is that it creates something, with no prerequisites, exclusions, or contextual conditions stated.

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