Skip to main content
Glama

createPromocode

Create a promocode that members enter to redeem a coupon, in the coupon's location. Returns the created promocode. The code must be unique in the location, ignoring case. A redemption limit cannot exceed the coupon's own. Get couponRef from getCoupons. Never invent UUIDs; only use values from prior tool responses.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "promocode": "<promocode>"
    },
    "name": "createPromocode"
  }
}

Input Schema

NameRequiredDescriptionDefault
promocodeYesPromocode to create.

Output Schema

NameRequiredDescriptionDefault
promocodeYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-destructive, closed-world write, so the safety profile is covered. The description adds real business rules beyond that: case-insensitive uniqueness within the location, and a redemption limit that cannot exceed the coupon's own. It does not mention permissions or failure/error behavior, which keeps it at 4.

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 core action and return value, then constraints, then the UUID guardrail. Mostly tight, though the final two clauses ("Never invent UUIDs; only use values from prior tool responses") are somewhat redundant restatements of the same rule.

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?

An output schema exists, so return values need not be explained, and the description still confirms a created promocode is returned. For a nested-object write with uniqueness and cross-entity limit rules, the description covers the constraints an agent could otherwise violate; only permission/error behavior is unaddressed.

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 description coverage is 100%, so the baseline is 3, but the description adds constraints the schema does not encode: case-insensitive uniqueness of `code` per location and the upper bound on `limitedRedemption` relative to the coupon. It does not clarify the `expiration`/`limitByFirstPurchase` semantics, so not a 5.

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?

States a specific verb and resource ("Create a promocode") and defines the resource in terms of its role: a code members enter to redeem a coupon, scoped to the coupon's location. That relational definition separates it from sibling create tools such as createCoupon without needing to name them.

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?

Gives an explicit prerequisite workflow ("Get couponRef from getCoupons") and a hard guardrail against fabricating UUIDs, which is actionable when-to-use guidance. It stops short of naming when NOT to use it (e.g., versus createCoupon or bulk creation), so it is clear context rather than full routing.

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