Skip to main content
Glama

create_coupon

[Buy] Generate one or more coupon/promo codes attached to a campaign. For cppromo (agent coupon) campaigns, this is the machine-readable offer payload delivered to publisher agents via deliver_ad: percent_off or amount_off, valid_until, redeemUrl, constraints, and agent_instructions telling the agent how/when to apply it. Also usable for end-user redemption on legacy cpa/cpl/cpi offers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNopercent = percent_off (value 0-100); fixed = amount_off in credits. Default fixed.
countNoHow many codes to generate (default 1).
valueNopercent_off (0-100) or amount_off credits, per type.
prefixNo
expiresAtNoISO 8601 expiry (valid_until), optional.
redeemUrlNoWhere the agent/user redeems the offer, if not auto-applied.
campaignIdYes
maxRedemptionsNoPer-code redemption limit (default 1).
constraintsJsonNoMachine-readable eligibility rules, e.g. { allowedSkus, region, minOrderCredits }.
minSpendCreditsNoMinimum spend in credits for the offer to apply.
agentInstructionsNoPlain-language instructions telling the agent how/when to apply this offer.

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It explains the payload structure and delivery mechanism, but lacks mention of side effects like cost, persistence, or reversibility. As a creation tool, this information would be valuable, but the description provides some useful context beyond a simple 'create' statement.

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?

The description is two sentences, front-loading the primary action and then adding relevant contextual detail. There is no filler; every clause contributes to understanding the tool's purpose and application.

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?

Given the tool's complexity (11 parameters, nested objects, no output schema), the description covers the main purpose and use cases but omits important contextual details such as return value format, cost implications, and required campaign ID semantics. The schema fills many gaps, but the description alone is not fully complete for a tool of this complexity.

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 82%, so most parameters are already well-documented. The description adds value by explaining how parameters map to the machine-readable offer payload (e.g., percent_off or amount_off, valid_until, redeemUrl) and how they are used by agent instructions. This enriches understanding without redundantly repeating schema descriptions.

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 clearly states the core action: 'Generate one or more coupon/promo codes attached to a campaign.' It distinguishes between cppromo agent coupons and legacy cpa/cpl/cpi offers, making it easy to differentiate from sibling tools like create_campaign or deliver_ad.

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?

The description gives explicit context for when to use the tool: for cppromo campaigns as a machine-readable payload delivered via deliver_ad, and for end-user redemption on legacy offers. It does not explicitly state when not to use it, but the context is sufficient to infer appropriate usage.

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.

TDQS

C2.8/5.0
Disambiguation2/5

Multiple tools have overlapping or misleading purposes: buy_campaign and buy_placement are aliases of create_campaign, list_placement actually creates a placement, and get_attribution/get_campaign both provide campaign stats. The report_* tools are distinct but similarly named, increasing selection risk.

Naming Consistency3/5

Most tools follow a verb_noun snake_case pattern, but there are notable deviations: buy_campaign/buy_placement use 'buy' instead of 'create', list_placement is a creator not a lister, and simple nouns like 'wallet' and 'whoami' break the convention.

Tool Count2/5

At 31 tools, the server feels heavy. Several tools are redundant aliases (buy_campaign, buy_placement) or could be consolidated (multiple report_* and list_* variants), making the surface unnecessarily large for the ad marketplace domain.

Completeness3/5

The core lifecycle is covered: campaign/placement creation, delivery, reporting, attribution, refunds, and cashouts. However, there are gaps like no update_campaign, no true list_placements, and no get_placement, leaving some workflows incomplete.