Skip to main content
Glama

apply_promo_code_to_customer

Apply a registered Stripe promotion code to a customer's subscription, with dry-run preview and idempotent execution for safe application.

Instructions

Apply a user-facing promotion code already registered in Stripe (e.g. 'LAUNCH50') to your account's Stripe subscription (POST /v1/tier2/promo/apply). Founder-operations only (an internal support tool; general accounts get 403). It will not be opened up without terms covering economically impactful operations (timing undecided). 409 if an active discount already exists (structural defense against stacking), and 409 when the status is canceled / incomplete_expired. Redemption is delegated to Stripe via promotion_code (applying coupons directly is forbidden as a constraint bypass); dryRun must be passed explicitly, and idempotencyKey is required when dryRun=false. Re-calls with the same key return the cached result via the tier2_idempotency table, structurally serializing concurrent applies. dryRun=true previews resolution + the active-discount check + the estimated discount only (no Stripe mutation); dryRun=false applies the promotion code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dryRunYesMust be passed explicitly. true = preview only; false = actual promotion-code application + Stripe mutation
reasonYesReason for applying it (recorded in the audit log; required, 200 chars max)
promoCodeYesPromotion code already registered in Stripe (e.g. 'LAUNCH50'; alphanumerics plus '_-', 64 chars max)
approvalIdNoApproval id granted via request_approval (apr_ + 32 hex; create with action 'apply_promo_code_to_customer'). Server-side verification + atomic consumption on a fresh execution (1 approval = 1 execution chain; retries with the same idempotencyKey do not re-consume). dryRun only verifies
idempotencyKeyNoRequired when dryRun=false. 16-128 chars alphanumeric plus '_-'; re-calls with the same key return the cached result
targetAccountIdYesTarget account id (your own account only for now; specifying another user gets 403)
Behavior5/5

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

With no annotations, the description fully discloses behaviors: error codes (403, 409), idempotency via tier2_idempotency table, delegation to Stripe, atomic consumption of approvalId, and dryRun semantics. No contradictions.

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 description is front-loaded with purpose and restrictions, then details parameters and behaviors. It is well-structured but slightly verbose; some sentences could be merged. However, every part adds value.

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 no output schema, the description covers purpose, error conditions, parameter details, and idempotency. It lacks explicit return format but mentions preview output for dryRun. Adequate for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

While schema coverage is 100%, the description adds significant context beyond schema: dryRun effects, idempotencyKey requirement, approvalId consumption pattern, targetAccountId restriction. It explains parameter interactions and constraints.

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 tool applies a promotion code to a Stripe subscription, specifying the resource (promotion code), action (apply), and constraints (registered in Stripe, user-facing). It distinguishes from siblings as there is no other promo-related tool in the list.

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?

Explicitly limits usage to founder-operations (403 for others), explains when not to use (active discount or canceled status), and provides guidance on dryRun vs actual application. No comparison to siblings needed as no alternative exists.

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/argosvix/mcp-server'

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