Skip to main content
Glama

Create discount code

create_discount_code
Destructive

Make a code buyers type on the payment page, in the owner's Stripe account; turns the site's code field on. One of percentOff or amountOffCents. A code takes its discount off the whole order, on every site that takes orders through the same Stripe account. Full reference: get_reference {topic:"shop"}.

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": {
      "siteId": "<siteId>",
      "code": "<code>"
    },
    "name": "create_discount_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes3-20 letters/digits, e.g. "SUMMER10"
endsAtNo"2026-08-31"
siteIdYesSite id (from list_sites)
currencyNo
percentOffNo
firstTimeOnlyNo
amountOffCentsNo
maxRedemptionsNo
minimumOrderCentsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Beyond the annotations, the description discloses two non-obvious behaviors: the code is created in the owner's Stripe account and turns the site's code field on, and the discount applies to the whole order across every site sharing that Stripe account. That cross-site blast radius is exactly the kind of context annotations cannot convey. It stops short of covering failure modes such as duplicate codes or what happens if Stripe is not configured.

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?

Four short clauses, front-loaded with the action and the side effect, followed by the key constraint and the reference pointer. Slightly clipped phrasing ("Make a code buyers type") costs a little readability but nothing is padded.

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 write tool with no output schema and destructiveHint=true, the description covers purpose, side effect, scope of effect, and one mutual-exclusion rule, and it points at get_reference {topic:"shop"} for depth. It still leaves the majority of optional parameters and the result of a failed or duplicate creation unexplained.

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 only 33% across 9 parameters, so the description needs to compensate and it partly does: it states the one-of percentOff/amountOffCents rule, which the schema does not encode via oneOf. However, endsAt, currency, firstTimeOnly, maxRedemptions, and minimumOrderCents receive no semantic explanation anywhere, leaving most optional parameters to inference.

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 description gives a concrete verb phrase and resource: "Make a code buyers type on the payment page" and "turns the site's code field on." It is clearly a discount-code creation tool, distinguishable from the sibling expire_discount_code, though it never names that sibling to draw the contrast explicitly.

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

Usage Guidelines3/5

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

Usage is implied (issue a buyer-facing code in the owner's Stripe account) and the constraint "One of percentOff or amountOffCents" helps the agent pick arguments. There is no explicit when-to-use / when-not guidance and no mention of prerequisites or what to do instead if the account is not connected to Stripe.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources