Skip to main content
Glama

Save Discount

save_discount
Destructive

Create or edit a catalog discount, as the Discounts page does. Omit discountId to create (name, type and discountPercentage required); pass it to edit, where every omitted field keeps its value and a supplied items/brandIds/categoryIds list replaces the old one. type: general (everyone), coupon (couponCode required, unique) or business (businessDiscountGroupId from list_discounts). validFrom and validUntil are YYYY-MM-DD days in the tenant's calendar and both are included: validUntil is the last day the discount applies. validFrom defaults to today. Limits are ANDed: an item must match every non-empty list. The preview shows the discount, what changes and how many items it matches; affected items' discounted prices update on commit. Requires an operator (unpinned) credential.

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": {
      "input": "<input>"
    },
    "name": "save_discount"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYesThe discount fields to set.
previewNoStep 1 of the required two-step write: set true to validate and receive a structured preview plus a single-use previewReceipt. Nothing changes until the commit call.
discountIdNoThe discount id (GUID) to edit; omit to create.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt to commit.
previewReceiptNoStep 2 of the required two-step write: the receipt returned by the preview call. Supply together with a fresh idempotencyKey to commit; calls without it are refused.

Output Schema

NameRequiredDescriptionDefault
okNo
deletedNo
previewNo
discountNo
expiresAtNo
actionItemIdNo
confirmationNo
correlationIdNo
approvalResultNo
idempotencyKeyNo
previewReceiptNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only flag this as destructive and non-idempotent; the description adds the substantive behavior behind that: omitted fields are preserved, supplied items/brandIds/categoryIds lists replace prior lists, limits are ANDed, and discounted prices update on commit. The previewReceipt/idempotencyKey gate and the credential prerequisite are disclosed here and nowhere else.

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?

Dense and front-loaded: mode selection first, then field semantics, then the two-step write and credential. Nearly every sentence carries a constraint, though the type enumeration and date-inclusivity rules overlap somewhat with schema text, making it longer than strictly necessary.

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?

Given a nested 5-parameter destructive write with an output schema, the description covers the mutation semantics, the preview/commit protocol, credential requirements, and date/list edge cases. Nothing an agent needs in order to call this correctly is missing, and return values are appropriately left to the output schema.

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 100%, so the baseline is 3; the description earns above it by adding cross-parameter semantics the schema cannot express, such as how type selection dictates required companions, that couponCode is unique, and that non-empty lists are ANDed rather than ORed. The per-field type details are largely duplicative of the schema, keeping it short of a 5.

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 specific verb and resource ("Create or edit a catalog discount") and immediately disambiguates the two modes via discountId. It also names the reference sibling (list_discounts) for the businessDiscountGroupId lookup, so the agent can place it in the catalog without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit routing rules: omit discountId to create, pass it to edit, with the required create-time fields enumerated. It further states the mandatory two-step preview-then-commit flow, the operator credential requirement, and when to call list_discounts, leaving little to inference.

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