Skip to main content
Glama

Manage discount codes

manage_discount_codes
Destructive

List, create, change, disable or delete the codes buyers enter at checkout: type percent (value 1-100) or fixed (value in major currency units, store currency by default), with an optional min_order, max_uses, starts_at and expires_at. "disable" keeps the code and its usage count; "delete" removes it. Codes are stored uppercase and must be unique per store.

Input Schema

NameRequiredDescriptionDefault
codeNoWhat buyers type, e.g. "WELCOME10" (stored uppercase)
typeNopercent off, or a fixed amount off
valueNopercent: 1-100. fixed: amount in major units (e.g. 200 = ₹200 off)
actionYes
activeNoWhether the code can be used (default true on create)
code_idNoFor update / disable / delete (from "list")
site_idYesThe site, from list_sites
currencyNofixed only; defaults to the store currency
max_usesNoTotal redemptions allowed; null = unlimited
min_orderNoMinimum order amount (major units) for the code to apply
starts_atNoISO date/time the code starts working; null = now
user_goalNoOptional: the user's goal behind this call, in one short sentence of plain words (e.g. "add a page so customers can book tables"). No names, emails or other personal details.
expires_atNoISO date/time the code stops working; null = never

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / user_goal
      Added value: +{
      +  "description": "Optional: the user's goal behind this call, in one short sentence of plain words (e.g. \"add a page so customers can book tables\"). No names, emails or other personal details.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true, idempotentHint=false and readOnlyHint=false, so the safety profile is covered. The description adds real value beyond that: the reversibility distinction between disable and delete, the uppercase normalization, and the per-store uniqueness constraint that will cause create/update failures. It stops short of stating required permissions or how 'list' output is shaped.

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?

A single front-loaded sentence that enumerates the actions before the qualifiers, followed by two short constraint sentences. Slightly over-packed — the type/value range restates the schema — but every sentence carries actionable content and nothing is buried.

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?

For a 13-parameter, five-action tool with no output schema, the description covers the actions and the core value/date parameters adequately. Gaps remain: it never explains that 'list' returns the code_id needed by update/disable/delete, nor what listing returns, which is the one thing an agent must know to chain the actions.

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 92%, so the schema already carries the parameter burden and baseline 3 applies. The description restates type/value ranges and mentions min_order, max_uses, starts_at and expires_at, but adds no syntax or format detail beyond the schema (e.g., ISO format, null semantics, or why code_id comes from list).

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 set (list, create, change, disable, delete) and a precisely scoped resource: the codes buyers enter at checkout. The type semantics (percent 1-100 vs fixed in major currency units) make it unmistakable what domain object is being managed, and no sibling tool covers discount codes.

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?

Explicitly resolves the one genuinely ambiguous action choice by contrasting "disable" (keeps the code and its usage count) with "delete" (removes it). There is no competing sibling to route away from, so the absence of when-not-to-use guidance is minor, but it still never says which action an agent should reach for first or whether list is a prerequisite for update/disable/delete.

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