Skip to main content
Glama

Select cart coupons

set_cart_coupons
DestructiveIdempotent

Set exactly which coupons the cart should use by passing coupon IDs from list_coupons; an empty list removes all coupons and the cart is read back to confirm.

Instructions

Make exactly these coupons the cart's selection, by couponId from list_coupons; an empty list removes them all. Only when the user asks to use or stop using coupons. It submits the cart's own coupon form and confirms the result by reading the cart back. A coupon is applied at checkout, on the website. If the result has mutation.outcome "unknown", the selection may have changed: call list_coupons before any further change and never repeat the request automatically.

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": {
      "couponIds": "<couponIds>"
    },
    "name": "set_cart_coupons"
  }
}

Input Schema

NameRequiredDescriptionDefault
couponIdsYesCoupon IDs from list_coupons: the complete selection the cart should have. An empty array removes every selected coupon.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.15.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=true, but the description adds real operational detail beyond them: it submits the cart's own coupon form, verifies by reading the cart back, clarifies that coupons are actually applied at checkout on the website, and gives a recovery rule for mutation.outcome "unknown" (re-list, never auto-retry). That is exactly the kind of consequence and failure-mode disclosure the annotations cannot carry.

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?

The action and its replacement semantics are front-loaded, and each subsequent sentence adds a distinct fact (gating condition, mechanism, unknown-outcome handling). The checkout/website sentence is slightly displaced from the rest of the flow, but nothing is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter mutation with an output schema present, the definition covers what is needed: the replacement contract, ID provenance, the destructive empty-list case, server-side verification, and the ambiguous-result recovery path. Nothing an agent needs in order to call it safely is missing.

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 coverage is 100% and the single couponIds parameter is already documented as "the complete selection the cart should have" with the empty-array case. The description restates rather than extends that, so it earns the baseline 3 for a fully documented parameter set.

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?

"Make exactly these coupons the cart's selection, by couponId from list_coupons; an empty list removes them all" states a specific verb (set/replace the selection), the resource (cart coupons), and the replace-not-append semantics in one line. The empty-array case is spelled out, so an agent can distinguish this from list_coupons or any add/remove style sibling without opening the schema.

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?

"Only when the user asks to use or stop using coupons" gives an explicit gating condition, and the description points at list_coupons as the source of IDs. It does not name a sibling to use instead for adjacent needs (e.g. inspecting the cart first), so it falls short of full when/when-not/alternative coverage.

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