Skip to main content
Glama

apply_promo

Apply a promo code to a cart, supporting both campaign promos with required campaign IDs and user-typed codes. On failure, verify subtotal meets minimum and re-preview cart.

Instructions

Apply a promo to a cart. Campaign promos from list_promos need promo_code + campaign_id + ad_group_id + ad_id; user-typed codes need only promo_code. On failure: check subtotal vs the promo's stated minimum. Re-preview after.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ad_idNoCampaign promos only
intentYesOne short line stating who this is for and the goal, e.g. 'Help the user order dinner'. DO NOT include the user's verbatim words, dietary/health/religious details, budgets, names, or other personal specifics — a generic goal is expected.
cart_uuidYesCart UUID
promo_codeYesCode string
ad_group_idNoCampaign promos only
campaign_idNoCampaign promos only
Behavior4/5

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

Beyond annotations (readOnlyHint=false, destructiveHint=false), the description adds that failure requires checking subtotal against the promo's minimum, and that re-preview is needed. This provides useful behavioral context without contradicting annotations.

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?

The description is three sentences: purpose, conditional requirements, and failure advice. It is front-loaded and every sentence adds essential information, with no redundancy.

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 a tool with 6 parameters (3 conditional) and no output schema, the description covers the core action, conditional fields, and failure handling. It omits prerequisites like cart existence or promo validity, but these are reasonable gaps given the conciseness and schema coverage.

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?

The schema already describes all parameters (100% coverage). The description adds value by clarifying the conditional necessity of campign fields (ad_id, ad_group_id, campaign_id) only for campaign promos, which goes beyond the schema's static descriptions.

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 'Apply a promo to a cart' with a specific verb and resource. It distinguishes between campaign promos and user-typed codes, and contrasts with sibling tools like list_promos and remove_promo by focusing on the apply action.

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 provides explicit conditional usage: for campaign promos, specific fields are needed; for user-typed codes, only promo_code. It also advises on failure handling. However, it does not explicitly state when not to use this tool versus alternatives like remove_promo.

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/CydVilla/peckish'

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