Skip to main content
Glama

create_price_rule

Create a discount rule to define promotional offers on your store, including discount type, value, target items, and customer eligibility.

Instructions

Create a new price rule (discount rule). Side effect: creates a PriceRule record. value must be a STRING (e.g. "-10.0" for 10% off). title, value_type, value, target_type, allocation_method, customer_selection, target_selection are required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesPrice rule display title. Required.
valueYesDiscount value as string — negative for discount (e.g. "-10.0" = 10% off). Required.
ends_onNoEnd date (ISO 8601). null = no expiry.
starts_onNoStart date (ISO 8601). If omitted, rule is immediately active.
value_typeYesType of discount: percentage, fixed_amount, or shipping. Required.
target_typeYesWhat the discount applies to. Required.
usage_limitNoMax total uses. null = unlimited.
target_selectionYesWhich items are targeted: all or entitled only. Required.
allocation_methodYesHow discount is allocated across items. Required.
once_per_customerNoLimit to one use per customer.
customer_selectionYesWhich customers qualify: all or those meeting prerequisites. Required.
Behavior4/5

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

With no annotations, the description discloses the side effect and highlights a critical value format requirement. Could enrich with permission needs or activation behavior, but it addresses the core mutation transparency.

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 concise sentences front-load purpose and side effect, then highlight key constraints. No wasteful prose; every sentence carries meaning.

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?

Given full schema coverage and no output schema, the description covers purpose, side effect, and required fields. It lacks return-value details but that's not required here; overall adequate for a create tool.

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 description adds little beyond schema details. It reiterates the value format and required fields, but these are already documented in the input schema.

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?

Clearly states the action ('Create') and resource ('price rule'), with a helpful side-effect note ('creates a PriceRule record'). Distinguishes from sibling tools like update_price_rule and list_price_rules.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or alternative guidance. The purpose is obvious from the name and description, but lacks contextual cues about when to choose this over other price rule operations.

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