Skip to main content
Glama

create_discount_code

Generate a unique discount code for a price rule so customers can apply it at checkout.

Instructions

Create a discount code for a price rule. Side effect: creates a DiscountCode that customers can apply at checkout. Code must be unique across the store.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesDiscount code string (e.g. "SUMMER10"). Must be unique. Required.
price_rule_idYesPrice rule ID to create the discount code under. Required.
Behavior3/5

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

With no annotations provided, the description carries the burden. It discloses the side effect (creates a customer-applicable code) and the uniqueness constraint, which is useful. However, it omits other behavioral details such as auth requirements, idempotency, or error handling, making it adequate but not rich.

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 sentences, front-loaded with the primary action, and every sentence earns its place. No redundancy or filler.

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?

The tool is simple (2 params, no nested objects) and the description covers purpose, side effect, and a constraint. Without an output schema, it could mention return value, but the missing detail is minor given the simplicity and clear sibling context.

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?

The input schema covers both parameters with descriptions and 100% coverage, so the description adds little beyond restating the uniqueness constraint already in the schema. Baseline 3 is appropriate given high schema coverage.

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 verb 'Create' with the resource 'discount code for a price rule', and distinguishes it from sibling tools like create_price_rule. The side effect explanation ('customers can apply at checkout') further clarifies the tool's unique role.

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 implies the prerequisite of an existing price rule ('for a price rule') and the uniqueness requirement, giving clear context. It does not explicitly exclude alternatives or mention when not to use it, but the context is sufficient for a simple create operation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nguyennguyenit/Sapo-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server