Skip to main content
Glama

Create or register coupon code

create_coupon
Idempotent

Give an affiliate a discount code so sales using it are credited to them. With createInProvider true, LinkJolt creates the code in the brand's connected Stripe, Polar or Creem (the one it creates codes in unless provider is given), as the dashboard's Add coupon does: set percentOff, or amountOff with currency, and duration (once, forever, or repeating with durationInMonths). Without it, the code must already exist in the payment platform and this registers it (for a Stripe code customers type, pass its promo_ id). Confirm the code, the discount and the affiliate with the person first. If no platform that creates codes is connected, the answer gives the link to connect Stripe. Requires an Ultimate or Scale plan key with write access; a test key only registers.

Input Schema

NameRequiredDescriptionDefault
codeYesThe readable code, e.g. SARAH20
currencyNo3-letter ISO code for amountOff
durationNoWith createInProvider: how long the discount lasts for a customer
providerNoWhere the discount lives (default stripe when registering; with createInProvider, the platform the brand creates codes in)
amountOffNoFixed amount off, with currency: the real discount with createInProvider, a label when registering
campaignIdYesThe campaign the coupon belongs to
percentOffNoPercent off (1-100): the real discount with createInProvider, a label when registering
affiliateIdYesThe affiliate the code is attributed to
descriptionNoWith createInProvider: the discount's name in the payment platform (default: the code)
appleOfferTypeNoApple offer type: 1 introductory, 2 promotional, 3 offer code
creemDiscountIdNoRegistering a Creem code: its discount id (dis_...)
polarDiscountIdNoRegistering a Polar code: its discount id
createInProviderNoCreate the code in the brand's connected Stripe, Polar or Creem instead of registering one that already exists
durationInMonthsNoWith duration repeating: for how many months (1-36)
paddleDiscountIdNoRegistering a Paddle code: its discount id (dsc_...)
stripePromotionCodeIdNoRegistering a Stripe code: its promotion code id (promo_...). Needed for a code customers type: Stripe sends only this id with the sale, never the code text

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?

Beyond the annotations (which only declare it is not read-only and is idempotent), the description discloses that it writes to an external payment platform (Stripe/Polar/Creem), which field values are real vs. cosmetic in each mode, the plan/key permission requirement, and the edge case that a missing platform connection returns a connect link rather than creating anything.

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?

Front-loaded with the outcome, then modes, then prerequisites — good ordering and no filler. It is a dense run-on paragraph with long clauses, which slightly hurts scannability for a 16-parameter tool, but every sentence carries information.

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?

For a 16-parameter, dual-mode, external-write tool with no output schema, it covers the essentials: mode selection, required permission tier, provider defaults, what happens on failure (connect link), and a confirmation step. Nothing an agent needs in order to call this correctly is missing.

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 a bump by explaining the mode-dependent default provider ('the one it creates codes in unless provider is given') and the promo_ id requirement for typed Stripe codes. Most individual field meanings (percentOff, amountOff with currency, duration values) are already in the schema, so it is additive rather than essential.

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+resource+benefit ('Give an affiliate a discount code so sales using it are credited to them') and immediately distinguishes itself from list_coupons by describing creation/registration rather than listing. It also splits its own two modes into named operations (create in provider vs. register existing), so an agent knows exactly what this tool does.

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?

Explicitly states the two usage modes and the switching condition: 'With createInProvider true, LinkJolt creates the code... Without it, the code must already exist in the payment platform and this registers it.' It adds prerequisites (Ultimate or Scale plan key with write access; a test key only registers) and a procedural instruction ('Confirm the code, the discount and the affiliate with the person 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.

Resources