Skip to main content
Glama

Create Discount

discount_create

Creates a Plan Builder discount. Requires name, status, type (percentage or fixed_amount), value, duration (forever or limited with duration_interval_count billing cycles) and availability (all stores or specific ones in specific_shop_domains). A code discount needs code (unique per app, stored uppercase): it applies when a merchant types it at subscribe. With auto_apply: true it has no code and applies by itself to every matching new subscription, so creating it active REQUIRES confirm: true. Optional plan_ids restricts it to plans (empty: every plan), max_redemptions caps its uses, description. Subscriptions keep a discount they got after it is deactivated. Takes the app_id returned by apps_list. Returns the same shape as discount_get.

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": {
      "app_id": "<app_id>",
      "name": "<name>",
      "status": "<status>",
      "type": "<type>",
      "value": "<value>",
      "duration": "<duration>",
      "availability": "<availability>"
    },
    "name": "discount_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoThe code merchants type, stored uppercase and unique per app. Required unless `auto_apply` is true; an automatic discount has no code.
nameYesInternal name of the discount.
typeYes`percentage` off the plan price, or a `fixed_amount` in USD.
valueYesThe percentage (0.01 to 100) or the USD amount (min 0.01).
app_idYesThe app uuid returned by `apps_list`.
statusYes`active` applies it from now on; `inactive` keeps it off. Deactivate a discount with `inactive`.
confirmNoMust be `true` when the write leaves an automatic discount active (anything beyond its name or description). Ignored otherwise.
durationYes`forever`, or `limited` to a number of billing cycles.
plan_idsNoPlan uuids (`plan_id` from `plans_list`) the discount is restricted to. Empty or omitted: every plan.
auto_applyNoTrue for an automatic discount: applied to every matching new subscription without a code. Writing an active automatic discount requires `confirm: true`.
descriptionNoOptional description.
availabilityYes`all` stores, or `specific` stores listed in `specific_shop_domains`.
max_redemptionsNoHow many subscriptions may use it in total (min 1). Null: no limit.
organization_idNoAn organisation uuid or slug. When supplied, `app_id` is resolved within that organisation and may be a slug instead of a uuid, mirroring the Meridian web app.
specific_shop_domainsNoThe *.myshopify.com domains allowed when `availability` is `specific`.
duration_interval_countNoBilling cycles the discount lasts. Required when `duration` is `limited`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare it is a non-destructive write; the description carries the real weight, disclosing that codes are stored uppercase and unique per app, that active auto-applied discounts require `confirm: true`, and that subscriptions retain a discount after deactivation. It also points at the return shape via `discount_get`, which matters since there is no output schema.

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?

Front-loads required fields and the code/auto_apply fork before optional details, so scanning works well. It is dense but nearly every clause adds a constraint; the only waste is mild repetition of enum meanings already in the schema.

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

Completeness5/5

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

For a 16-parameter creation tool with no output schema, the description covers the required set, the conditional fields, the confirm gate, and the return shape by reference to `discount_get`. Nothing an agent needs in order to call it correctly appears to be missing.

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?

Schema coverage is already 100%, so baseline is 3, but the description adds cross-parameter meaning the schema states only in scattered per-field text: `duration_interval_count` pairs with `duration: limited`, `specific_shop_domains` pairs with `availability: specific`, and `code` is mutually exclusive with `auto_apply`. That dependency framing is genuine added value.

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?

Opens with a concrete verb+resource ('Creates a Plan Builder discount') and immediately enumerates the defining dimensions (code vs auto_apply, percentage vs fixed_amount, duration, availability). An agent can distinguish this from discount_update, discount_get, and discounts_list without opening another schema.

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?

Gives strong conditional guidance: code discounts need `code`, auto_apply discounts need `confirm: true` when created active, `plan_ids` empty means every plan. It does not explicitly say when to prefer discount_update over creating a new one, so it falls short of full when/when-not/alternative routing.

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