Skip to main content
Glama
Jacques-Murray

WooCommerce MCP Server

Create WooCommerce Coupon

woocommerce_create_coupon

Create a discount coupon in WooCommerce by specifying a unique code, discount type, and amount. Supports optional settings like expiry date, usage limits, and product restrictions.

Instructions

Create a new discount coupon.

Args:

  • code (string, required): the code customers enter at checkout

  • discount_type: 'percent'|'fixed_cart'|'fixed_product' (default: fixed_cart)

  • amount (string, required): numeric string

  • description, date_expires (YYYY-MM-DD), individual_use, usage_limit, usage_limit_per_user, free_shipping, minimum_amount, maximum_amount, product_ids, excluded_product_ids, email_restrictions (all optional)

  • response_format ('markdown'|'json'): default 'markdown'

Returns: The newly created coupon object with its assigned ID.

Examples:

  • Use when: "create a 20% off coupon called SUMMER20 that expires end of August" -> code="SUMMER20", discount_type="percent", amount="20", date_expires="2026-08-31"

Error Handling:

  • Returns "Error: Bad request (400)" if the coupon code already exists.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesCoupon code customers will enter at checkout, e.g. 'SUMMER20'
amountYesDiscount amount as numeric string (percent value or currency amount depending on discount_type)
descriptionNo
product_idsNoRestrict coupon to these product IDs
usage_limitNoMax total number of times this coupon can be used
date_expiresNoExpiry date in YYYY-MM-DD format; omit for no expiry
discount_typeNo'percent', 'fixed_cart', or 'fixed_product' (default: fixed_cart)fixed_cart
free_shippingNoIf true, grants free shipping when applied
individual_useNoIf true, this coupon cannot be combined with other coupons
maximum_amountNoMaximum cart subtotal allowed, numeric string
minimum_amountNoMinimum cart subtotal required, numeric string
response_formatNoOutput format: 'markdown' for human-readable text or 'json' for machine-readable structured datamarkdown
email_restrictionsNoRestrict usage to these customer email addresses
excluded_product_idsNoExclude these product IDs from the coupon
usage_limit_per_userNoMax times a single customer can use this coupon
Behavior4/5

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

Annotations indicate write, non-idempotent, safe operation. Description adds return format, error handling, and creation behavior. No contradiction with annotations.

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

Conciseness5/5

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

The description is well-structured with bullet points, sections (Args, Returns, Examples, Error Handling), and front-loaded with the main action. No redundant sentences.

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

Completeness4/5

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

Given 15 parameters and no output schema, the description covers creation details, error handling, and an example. It doesn't detail the returned object, but the context is adequate for an AI agent.

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

Parameters4/5

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

With 93% schema coverage, the description adds value by providing an example, summarizing defaults, and explaining the response_format parameter beyond the schema.

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

Purpose5/5

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

The description clearly states 'Create a new discount coupon', matching the title and specifying the resource. It distinguishes itself from sibling tools like woocommerce_update_coupon and woocommerce_delete_coupon.

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

Usage Guidelines4/5

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

The description provides an explicit example with 'Use when' and error handling for duplicate codes. It lacks explicit when-not-to-use guidance, but the example and context make usage clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jacques-Murray/woocommerce-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server