Skip to main content
Glama

Update discount

update_discount
Destructive

Update a discount: rename, change amount, enable/disable, adjust validity or usage limit. Omitted or null fields keep their value; send "" to clear the message. The discount type cannot be changed, and a bulk coupon keeps its generated codes: code has no effect on it, use expire_discount_code to retire individual codes.

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

Input Schema

NameRequiredDescriptionDefault
codeNo
nameNo
limitNoMaximum number of uses. 0 = unlimited.
amountNoPercentage (0-100) or fixed amount in minor units (cents), depending on the discount amount_type.
enabledNofalse deactivates the discount, true re-enables it.
messageNo
valid_fromNo
discount_idYesThe discount id.
valid_untilNo
no_expirationNo

Output Schema

NameRequiredDescriptionDefault
idYes
codeNo
nameNo
typeNo
limitNo
amountNo
enabledNo
messageNo
currencyNo
code_typeNo
is_activeYes
categoriesNo
times_usedNo
valid_fromNo
amount_typeNo
bulk_configNo
valid_untilNo
all_productsNo
dashboard_urlYes
no_expirationNo
amount_appliedNo
applies_to_allNo
products_countYes
codes_availableYes
applies_to_countYes
show_countdown_timerNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true and openWorldHint=true, so the safety profile is covered. The description adds genuinely non-obvious behavior beyond that: omitted or null fields preserve their value, "" clears the message, and the discount type is immutable. However, the destructiveHint=true flag is left unexplained — the description implies only the message field is ever cleared, and says nothing about permission requirements or whether amount changes affect already-issued codes.

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?

Three tight sentences, each front-loaded with the highest-value information: what can change, how omission/null behaves, and which mutations are forbidden or redirected. No filler or restatement of the title.

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?

An output schema exists, so return values need no explanation, and the description covers the two hardest things about a partial-update mutation: null-means-keep and the message-clearing sentinel. The gap is no_expiration, an undocumented parameter whose interaction with valid_until is left entirely to inference.

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 coverage is only 40% across 10 parameters, so the description must compensate. It clarifies partial-update semantics for all fields, the "" sentinel for message, and that code is a no-op on bulk coupons, but it says nothing about no_expiration (never mentioned) or how valid_from/valid_until interact with it, and does not state the format for dates. The three schema-described fields (limit, amount, enabled) already carry their own meaning.

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 ("Update a discount") and enumerates the mutable surface: rename, amount, enable/disable, validity, usage limit. It distinguishes itself from expire_discount_code and from create_discount by naming the code-retirement path explicitly, though it never contrasts with create_discount or list_discounts by name.

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?

It routes the agent correctly for one key decision: "a bulk coupon keeps its generated codes: code has no effect on it, use expire_discount_code to retire individual codes." That is a real when-to-use-a-different-tool statement. It stops short of exclusions or prerequisites (permissions, whether the discount must be inactive first).

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.