Skip to main content
Glama
@cmssy/mcp-server

@cmssy/mcp-server

Official

Update discount

update_discount
Destructive

Partially update a discount's value, schedule, status, usage limit, or currency minimums while preserving code, type, and currency once the discount has been used.

Instructions

Update a discount (partial). code/type/currency become immutable once the discount has been used. A code with any minimum (minSubtotal for the default currency, minSubtotalByCurrency for additional currencies) applies only in the currencies those minimums name.

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": {
      "idOrSlug": "<idOrSlug>"
    },
    "name": "update_discount"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNo
typeNo
valueNo
endsAtNoISO date-time
enabledNo
maxUsesNo
currencyNo
idOrSlugYesThe discount's id or code to update
startsAtNoISO date-time
minSubtotalNoMinimum subtotal in minor units: the code's own currency for 'fixed', the default currency otherwise. null clears it - with minSubtotalByCurrency set, the code then no longer applies to default-currency carts
minSubtotalByCurrencyNo'percentage' and 'free_shipping' only: replaces the per-currency minimums for carts in additional currencies; [] clears them. Omit to keep them. Changing such a code to 'fixed' needs [] here

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv0.73.2
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / currency / pattern
      Added value: +"^[A-Z]{3}$"
    • addedInput schema / properties / minSubtotal / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / minSubtotal / description
      Added value: +"Minimum subtotal in minor units: the code's own currency for 'fixed', the default currency otherwise. null clears it - with minSubtotalByCurrency set, the code then no longer applies to default-currency carts"
    • removedInput schema / properties / minSubtotal / type
      Removed value: -"number"
    • addedInput schema / properties / minSubtotalByCurrency
      Added value: +{
      +  "description": "'percentage' and 'free_shipping' only: replaces the per-currency minimums for carts in additional currencies; [] clears them. Omit to keep them. Changing such a code to 'fixed' needs [] here",
      +  "items": {
      +    "properties": {
      +      "amount": {
      +        "description": "Minor units of that currency",
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "currency": {
      +        "description": "One of the workspace's additional currencies (update_cart_config additionalCurrencies)",
      +        "pattern": "^[A-Z]{3}$",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "currency",
      +      "amount"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 9,
      +  "type": "array"
      +}
    • addedInput schema / required
      Added value: +[
      +  "idOrSlug"
      +]
  2. First observedv0.73.1

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already state readOnlyHint=false and destructiveHint=true, so the description does not need to restate the safety profile. It adds non-obvious behavior: code/type/currency become immutable once the discount has been used, and minimum constraints apply only to the currencies they name. It still does not explain what 'used' means or exactly how omitted fields are handled.

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 definition is two sentences and front-loads the operation and key caveats. Every phrase conveys a constraint or semantic detail; there is no filler.

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 an 11-parameter destructive update with no output schema, the description covers the most important non-obvious constraints. It still lacks return/response semantics and a full explanation of partial-update behavior for omitted fields, so it is not complete enough for the whole tool surface.

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?

With schema coverage at 45%, the description must add meaning, and it does for the most complex fields: minSubtotal, minSubtotalByCurrency, and the immutability of code/type/currency. Yet it leaves many parameters (value, enabled, maxUses, startsAt, endsAt, etc.) entirely to the schema, so it only partially compensates for the low coverage.

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 names a specific verb and resource ('Update a discount') and clarifies that it is a partial update, which distinguishes it from create/get operations. It does not explicitly name or differentiate against siblings such as set_discount_enabled, so it falls short of a perfect sibling-differentiation statement.

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?

The phrase '(partial)' implies using this tool for incremental changes, and the immutability note tells the agent some fields cannot be changed after the discount has been used. However, there is no explicit when-to-use/when-not-to-use guidance versus create_discount, set_discount_enabled, or get_discount.

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

Deploy Server

Other Tools