Skip to main content
Glama
thenavidm
by thenavidm

Create a discount code

create_discount_code
Destructive

Create a discount code for a partner and associate it with a referral link; the partner's group must already have a discount and each link supports one code.

Instructions

Create a discount code for a partner. The partner's group must already have a discount assigned to it, and the discount code must be associated with a link that is not already linked with another discount code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoThe discount code to create. If omitted, a unique code will be generated automatically from the partner's name. Stripe and Shopify codes can only contain letters, numbers, dashes, and underscores. Custom provider codes can contain any characters.
linkIdNoThe ID of the partner's referral link to associate this discount code with. Each link can only have one discount code.
accountNoExact configured private workspace profile label; not a tenant or provider account ID.
confirmNoMust be true for the requested mutation or exclusive private output file.
payloadNoComplete native JSON body; do not mix with body flags or payload_file. Arrays use repeated JSON object flags or a whole native array in a private file.
partnerIdNoThe ID of the partner to create a discount code for.
payload_fileNoAbsolute regular non-symlink JSON body file, at most 1 MiB. Cannot mix with payload/body flags.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false, and openWorldHint=true, so the safety profile is covered. The description adds genuinely new behavioral context in the form of business-rule preconditions not present in the schema or annotations, though it does not restate the confirm/destructive requirement.

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?

Two tight sentences with zero filler; the core action is front-loaded and the preconditions follow immediately. Every clause 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 a destructive, non-idempotent mutation with no output schema, the description supplies the key precondition rules an agent needs before calling. The main residual gap is that it does not surface the confirm-must-be-true requirement or the irreversibility implied by destructiveHint, but annotations carry that load.

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 100%, so the schema already documents code, linkId, partnerId, account, confirm, payload, and payload_file in detail. The description adds no parameter syntax or format information beyond what is already structured, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (Create) and resource (discount code) and adds scope ('for a partner'), which cleanly separates it from siblings like list_discount_codes and delete_discount_code. It stops short of explicitly naming an alternative tool, so it is clear but not maximally distinguishing.

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 two concrete preconditions for a successful call: the partner's group must already have a discount assigned, and the target link must not already carry another discount code. These are actionable when-to-use constraints, though no alternative tool is named for the failure cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.