Skip to main content
Glama

Pridly — AI copilot for PrestaShop

Create a discount code

create_coupon

Creates a coupon (percent or fixed amount) with optional expiry, usage limits and category restriction. Preview first, then confirm. Always show the preview to the user and get their explicit approval before calling again with confirm=true and the preview_id. Paid plans only. To apply it later instead of now, call with confirm=true, the preview_id AND apply_at (the store's local time, YYYY-MM-DDTHH:MM).

Input Schema

NameRequiredDescriptionDefault
codeNo
storeNoStore address or id. Leave empty if you have only one store.
amountNo
confirmNoSet true ONLY after the user approved the preview.
expiresNoLast valid day, YYYY-MM-DD (valid until the end of that day).
apply_atNoOnly with confirm=true: apply later. Store local time, YYYY-MM-DDTHH:MM, between 5 minutes and 90 days from now.
preview_idNoThe preview_id returned by the preview call (required with confirm=true).
usage_limitNo
discount_typeNo
minimum_amountNo
usage_limit_per_userNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and destructiveHint=false, so the description is free to add the two-phase commit behavior, the preview_id handshake, the paid-plan requirement, and the 5-minute-to-90-day window for apply_at. That is meaningful non-obvious behavior. It stops short of saying whether an existing code is rejected or overwritten, which matters for a creation tool.

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 the required preview-confirm sequence, and every sentence carries operational content. The preview/confirm instruction is stated twice in slightly different words ('Preview first, then confirm' and 'Always show the preview...'), which is minor redundancy rather than bloat.

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 an 11-parameter mutation tool with no output schema and zero required fields, this covers the workflow, prerequisites, and scheduling constraints well enough to call it correctly. Two gaps remain: nothing about what is returned after confirmation, and the phantom category-restriction mention.

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 45%, and the description compensates only partially: it explains the confirm/preview_id/apply_at workflow and discount shapes, but says nothing about code, amount, minimum_amount, or usage_limit_per_user semantics. It also references a 'category restriction' capability that has no corresponding parameter in the schema, which could mislead an agent into hunting for it.

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?

Opens with a specific verb and resource ('Creates a coupon') and enumerates the supported shapes (percent or fixed amount, optional expiry, usage limits, category restriction). It does not name the close sibling set_product_discount, so the agent must infer the boundary between a coupon and a product discount.

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

Usage Guidelines5/5

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

Gives an explicit protocol: preview first, show the preview to the user, get explicit approval, then call again with confirm=true and preview_id. It also states the paid-plans-only prerequisite and the exact path for scheduling later via apply_at. This is when-to-use and how-to-sequence guidance at the top of the scale.

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