Skip to main content
Glama

shopify_create_discount

Destructive

Create a percentage discount code with a start date and target audience. Preview changes with a dry run before applying to your Shopify store.

Instructions

Create a percentage discount code with an explicit start date and customer audience. Defaults to dryRun:true, which resolves segments and previews the discount without creating it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
storeYes
titleYes
dryRunNoTrue (the default) returns a before/after preview without changing anything in Shopify. Pass false, after the user authorizes this store and exact change, to apply it; the tool then reads the result back.
endsAtNo
startsAtYes
percentageYes
productIdsNo
usageLimitNo
collectionIdNo
minimumQuantityNo
customerSegmentsNo
customerEligibilityNo
minimumPurchaseAmountNo
appliesOncePerCustomerNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.0.1
    • removedInput schema / properties / confirm
      Removed value: -{
      -  "const": true,
      -  "description": "True only after authorization for this store and exact change.",
      -  "type": "boolean"
      -}
    • addedInput schema / properties / dryRun
      Added value: +{
      +  "default": true,
      +  "description": "True (the default) returns a before/after preview without changing anything in Shopify. Pass false, after the user authorizes this store and exact change, to apply it; the tool then reads the result back.",
      +  "type": "boolean"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "store",
      -  "title",
      -  "code",
      -  "percentage",
      -  "startsAt",
      -  "confirm"
      -]New value: +[
      +  "store",
      +  "title",
      +  "code",
      +  "percentage",
      +  "startsAt"
      +]
  2. Addedv1.6.0

TDQS

B3.1/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the mutation profile is known. The description adds genuinely useful behavior: dryRun defaults to true and resolves segments/previews without creating, which tells the agent the call is safe by default. It stops short of noting that dryRun:false performs an irreversible write.

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 core action front-loaded and the dryRun caveat following. No filler, though the second sentence could explicitly flag the write-vs-preview distinction more sharply.

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?

For a 15-parameter, 5-required destructive mutation with 7% schema coverage and no output schema, the description is far from complete. It covers the dryRun behavior well but omits the semantics of most parameters and any indication of what the read-back result contains.

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 only 7% (essentially just dryRun), so the description must carry the burden for 15 parameters. It alludes to percentage, start date, and customer audience, but leaves productIds, collectionId, usageLimit, minimumQuantity, minimumPurchaseAmount, appliesOncePerCustomer and others unexplained in both schema and description.

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?

States a specific verb and resource ('Create a percentage discount code') plus scope ('explicit start date and customer audience'). It is clearer than its siblings, none of which create discounts, though it never explicitly contrasts itself with a generic mutation tool like shopify_graphql_mutation.

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 explains the dryRun default but gives no guidance on when to use this tool versus alternatives such as shopify_graphql_mutation or shopify_run_action. No prerequisites or exclusions are stated.

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