Skip to main content
Glama

HamroLink Business OS MCP Server

commerce.apply_offer_or_discount

Destructive

Applies OR updates a special offer and linked storefront banner on a specific product variant (targetVariant/targetVariants) or on the whole product and all its variants in place (preserves existing promotion dates and regular prices unless explicitly changed) or adds a discount coupon code.

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": {
      "type": "<type>"
    },
    "name": "commerce.apply_offer_or_discount"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYesPromotion type: 'special_offer' updates live offerPrice & banner; 'coupon' adds checkout promo code; 'remove_offer' resets
themeNoOptional banner color theme
siteIdNoOptional MongoDB Site ID
endDateNoOptional ISO expiry timestamp (omit to preserve existing)
headlineNoOptional storefront banner headline
badgeTextNoOptional pill badge text (e.g. '15% OFF')
productIdNoOptional product ID
startDateNoOptional ISO start timestamp (omit to preserve existing)
variantIdNoOptional exact variant ID to target (alias for targetVariant)
couponCodeNoCoupon code (e.g. 'SAVE10')
offerPriceNoSpecial offer price in NPR (e.g. 1530)
productNameNoProduct name to search and update
subheadlineNoOptional storefront banner subheadline
variantNameNoOptional variant name/label to target (alias for targetVariant)
durationDaysNoOptional duration in days
durationHoursNoOptional duration in hours
promotionNameNoOptional promotion/campaign name
publishBannerNoSet true to publish storefront banner, false for draft; omit to preserve
targetVariantNoOptional specific variant (e.g. '128GB', '8GB / 256GB', 'White / S', variant ID, or SKU) to discount or remove offer from. When provided, ONLY that variant is discounted and sibling variants keep their regular price. Omit to discount the whole product and all its variants.
targetVariantsNoOptional list of multiple specific variants (e.g. ['128GB', '256GB']) to apply or remove the discount on.
durationMinutesNoOptional duration in minutes from now
discountPercentageNoDiscount percentage (e.g. 15)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and openWorldHint=true, so the mutation profile is known. The description adds the useful in-place semantics (existing promotion dates and regular prices preserved unless explicitly changed), but it does not disclose what 'remove_offer' destroys or whether removal is reversible, and it duplicates the schema's own 'omit to preserve' wording.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single run-on sentence packs three alternative modes into nested parentheticals connected by repeated 'or', making it hard to parse on first read. The key scoping constraint (variant vs whole product) is buried mid-sentence rather than front-loaded.

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 a polymorphic 22-parameter mutation tool with no output schema, the description should explain what each type requires (offer fields vs couponCode vs remove_offer payloads). It covers targeting and preservation but leaves the per-mode required-field contract implicit, which is a real gap for a destructive write.

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 the schema already documents all 22 parameters, including the targetVariant sibling-preservation behavior verbatim. The description restates the variant-vs-whole-product distinction but adds no syntax, defaulting, or cross-parameter dependency information (e.g., that couponCode is needed when type='coupon').

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+resource (apply/update a special offer, banner, or coupon code) and distinguishes targeting scope (single variant vs whole product vs coupon). It never names a sibling it is not, so an agent cannot tell from the text alone how this differs from commerce.create_promotion or commerce.set_free_shipping.

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?

There is no when-to-use / when-not-to-use guidance and no alternatives are named, despite several sibling tools that also create discounts (restaurant.apply_discount, commerce.create_promotion, commerce.set_free_shipping). The only usage signal is the mode enumeration, which is carried by the schema enum rather than the prose.

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.