Skip to main content
Glama

Shoprocket MCP by usefulapi

Create discount code

shoprocket_create_discount_code
Destructive

WRITE: create a live discount code that shoppers can use at checkout and that reduces the store's revenue. Type fixed or percentage needs coupon_value; free_shipping does not. Use usage_limit and dates to bound it. Calling twice creates two codes. PUT /v1/discount-codes.

Input Schema

NameRequiredDescriptionDefault
start_dateNoFirst valid day, yyyy-mm-dd. Required together with expire_date.
coupon_codeNoThe code shoppers type. Default: Shoprocket generates a random one.
coupon_typeYesfixed = amount off, percentage = percent off, free_shipping.
descriptionYesWhat the code is for (shown in the dashboard).
expire_dateNoLast valid day, yyyy-mm-dd. Required together with start_date.
usage_limitNoMaximum number of uses in total.
coupon_valueNoRequired for fixed and percentage. Shoprocket documents 'a positive integer in cents': for fixed 500 = 5.00; for percentage send the whole percent (10 = 10%) and check the reply.
limit_per_userNo1 = one use per customer.
coupon_applies_toYesWhat it applies to. free_shipping allows only all_orders and all_orders_over.
minimum_order_valueNoMinimum order value in cents (as Shoprocket takes it); used with all_orders_over.
coupon_applies_to_valueNoRequired for multiple_products (comma-separated product ids) and categories (comma-separated category slugs).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, but the description adds real-world meaning beyond them: the code is live at checkout, reduces revenue, and duplicate calls produce duplicate codes. Endpoint 'PUT /v1/discount-codes' is also disclosed.

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?

Five short sentences, the mutation warning front-loaded, no filler. Every clause (revenue impact, conditional value, non-idempotency, endpoint) earns its place.

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 an 11-parameter destructive mutation with no output schema, the description covers the critical traps: non-idempotency, required coupon_value by type, and bounding via usage_limit/dates. It hints at verifying percentage responses ('check the reply') but gives no shape of the return.

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 100%, so the schema already documents every parameter including the conditional coupon_value rule and the coupon_value percent-vs-cents quirk. The description restates the fixed/percentage dependency but adds little syntax detail beyond the schema, so baseline 3 applies.

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?

The description opens with a specific verb and resource ('WRITE: create a live discount code') plus the concrete consequence ('shoppers can use at checkout and that reduces the store's revenue'), which cleanly separates it from get_discount_code and list_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?

It gives clear invocation guidance ('Type fixed or percentage needs coupon_value; free_shipping does not', 'Use usage_limit and dates to bound it') and warns that 'Calling twice creates two codes'. It stops short of naming a sibling alternative for read/list use cases, which keeps it from a 5.

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.