Skip to main content
Glama

Coupon Write Tool

coupon-write
Destructive

Create or update discount coupons. Requires coupon permission. Creation requires a unique code, type and discounts; percentage discounts cannot exceed 100. Updates replace supplied discount collections and can affect what clients pay.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoCoupon code (max 32, unique). Required for "create", optional for "update".
typeNoDiscount type: "percentage" (amount is 0–100 percent) or "fixed" (amount is a monetary value). Required for "create".
actionYesAction to perform.
durationNoWhether the discount applies for the full subscription duration. Optional.
coupon_idNoCoupon id. Required when updating an existing record.
discountsNoDiscount rules. Required for "create". Each entry has an "amount" and optional "services".
single_useNoAllow each customer to use the coupon only once. Optional.
descriptionNoInternal description of the coupon. Optional.
date_expiresNoExpiry date-time (e.g. "2026-12-31 23:59:59"). Optional; pass null on "update" to clear.
is_cart_totalNoFixed coupons only: take the amount off the eligible cart subtotal once, spread across the eligible items, instead of off every eligible item and quantity. Ignored (forced false) for percentage coupons. Optional.
new_customersNoRestrict the coupon to customers with no prior paid invoices. Optional.
min_cart_amountNoMinimum cart total required to use the coupon. Optional; pass null on "update" to clear.
single_quantityNoApply the discount to a single quantity only. Optional.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already indicate write and destructive behavior. The description adds useful context by explicitly warning that updates replace supplied discounts and can affect what clients pay, which goes beyond the raw schema.

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 compact, front-loaded with the core action, and packs essential operational details into two sentences without unnecessary filler.

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?

Despite having no output schema, the description covers the necessary context: permissions, required inputs, update behavior, and financial impact. It is sufficiently complete for an agent to decide when and how to invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the description adds meaningful constraints not obvious from types alone, such as 'required for create', 'pass null on update to clear', percentage limits, and fixed-coupon behavior. This strongly supports correct parameter usage.

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?

Description clearly states the tool creates or updates discount coupons, distinguishing it from the read-only sibling coupon-read. The verb and resource are specific and unambiguous.

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?

Mentions required coupon permission, creation requirements (unique code, type, discounts), and warns that updates replace discount collections. It does not explicitly say 'use coupon-read for retrieval', but the create/update framing makes the intended usage clear.

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