Skip to main content
Glama

WooCommerce: Create coupon

woocommerce_create_coupon

Create a WooCommerce coupon with percentage or fixed discounts, usage limits, expiry dates, and product restrictions to control promotions and redemptions.

Instructions

[UNIFIED] Create a new WooCommerce coupon. Supports percentage and fixed discounts with usage limits and restrictions.

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>",
      "amount": "<amount>"
    },
    "name": "woocommerce_create_coupon"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
siteYes
amountYes
descriptionNo
product_idsNo
usage_limitNo
date_expiresNo
discount_typeNopercent
free_shippingNo
individual_useNo
maximum_amountNo
minimum_amountNo
excluded_product_idsNo
usage_limit_per_userNo
limit_usage_to_x_itemsNo

Schema Changelog

Changes observed during successful MCP inspections.

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

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false and destructiveHint=false, so the safety profile is covered. The description adds only feature scope (discount types, usage limits, restrictions); it omits behavior the agent would care about, such as a duplicate-code failure mode implied by non-idempotency, or that the coupon takes effect in the live store immediately.

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 tight sentences with the action front-loaded and no padding beyond the bracketed "[UNIFIED]" tag, which is internal noise rather than agent-helpful content. Nothing is buried or repetitive.

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?

Fifteen parameters with zero schema descriptions, no output schema, and a mutation tool with only annotations for safety — this description is far too thin for that surface area. An agent could supply code and amount but would be guessing on the twelve optional fields and on what the tool returns.

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% across 15 parameters, so the description must carry the load and largely fails to. It hints that discount types include percentage and fixed (relevant to discount_type's 'percent' default) and gestures at usage_limit/usage_limit_per_user and product restrictions, but says nothing about code uniqueness, the string-typed amount, comma-separated product_ids, or date_expires format.

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 first sentence gives a specific verb+resource ("Create a new WooCommerce coupon"), which cleanly separates it from siblings like woocommerce_update_coupon, woocommerce_delete_coupon and woocommerce_list_coupons. It does not explicitly name those siblings, but the create semantics are unambiguous.

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?

The description never states when an agent should create a coupon versus updating one, nor any prerequisites (an existing site, a unique coupon code). The clause about percentage/fixed discounts and usage limits describes features rather than usage context, leaving the agent to infer the trigger condition.

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