Skip to main content
Glama

Create a discount code

create_coupon

Create a new discount code. Codes are stored uppercase and matched case-insensitively at checkout. Buyers can only type a code on checkouts that show a code box: this switches it on for the draft checkouts the code covers, and lists live ones still without it (codeBox.stillOff) for the seller to turn on.

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": {
      "code": "<code>",
      "kind": "<kind>",
      "value": "<value>"
    },
    "name": "create_coupon"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesThe code buyers type, e.g. BLACKFRIDAY. Letters and numbers.
kindYespercent = % off, fixed = amount off.
valueYesFor percent: 1-100. For fixed: the amount off in cents.
accountNoOnly to work in a client's account: its id from list_accounts. Leave it out for your own account.
expiresAtNoISO-8601 date/time when it stops working. Omit for never.
productSlugNoLimit to one product. Omit to apply to every product.
maxRedemptionsNoCap on total uses. Omit for unlimited.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A3.7/5.0
Behavior4/5

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

Annotations only declare that this is a non-destructive, closed-world write. The description goes well beyond that by disclosing non-obvious behavior: codes are stored uppercase, matched case-insensitively, and creating a code silently switches the code box on for draft checkouts while returning live checkouts still without it (codeBox.stillOff). It does not cover failure modes such as duplicate-code errors or permission requirements.

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?

Three sentences, front-loaded with the core action, with no filler. The third sentence is dense but each clause carries distinct behavioral information; minor compression could still improve readability.

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?

For a seven-parameter mutation with no output schema and no nested objects, the definition is solid: it explains the normalization rule and reveals a return value (codeBox.stillOff) that the missing output schema would otherwise leave opaque. The remaining gap is error/conflict behavior for an already-existing code.

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 all seven parameters are already documented in structured form, setting the baseline at 3. The description adds a small amount of meaning about how the `code` parameter is normalized (uppercase, case-insensitive matching), but says nothing extra about kind, value, account, expiresAt, productSlug, or maxRedemptions.

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 opens with a specific verb+resource ("Create a new discount code") and adds the code's storage/normalization behavior. It is immediately clear what the tool does, though it does not explicitly contrast with the existing siblings list_coupons or coupon_stats.

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 rather than stated: an agent can infer this is the tool for minting new codes. There is no explicit when-to-use/when-not guidance, no mention of prerequisites, and no pointer to list_coupons or coupon_stats for verification or reporting.

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.