Skip to main content
Glama

update_code

Idempotent

Change the attributes of ONE code. Only the fields you send change. IMPORTANT: description, value, external_url, expiration_date and expiration_time accept null, and null CLEARS the field — omitting a field leaves it untouched, sending null empties it. Do not send null unless the user asked to clear that field. The code itself (coupon_code) can only be renamed while it is unassigned and not redeemed. Requires the Codes & Coupons module enabled on the account — on 403 "module not enabled", do NOT retry; tell the user to contact Sweeppea support.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valueNoMax 10 characters. null CLEARS it; omit to leave unchanged
coupon_codeNoNew code — up to 20 letters, digits, - or _. Only while unassigned and not redeemed; must be unique in the sweepstakes
descriptionNoMax 5,000 characters. null CLEARS it; omit to leave unchanged
coupon_tokenYesThe code token (CouponToken, UUID v4)
external_urlNohttps:// link, max 500 characters. null CLEARS it; omit to leave unchanged
expiration_dateNoYYYY-MM-DD, not in the past. null CLEARS it; omit to leave unchanged
expiration_timeNoHH:mm, 24-hour clock. null CLEARS it; omit to leave unchanged

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only cover the safety profile (not readOnly, idempotent, open world). The description goes well beyond them, disclosing the null-clears-field semantics, the rename constraint tied to assignment/redemption state, the module-enablement prerequisite, and explicit 403 error handling (do not retry; escalate to support). That is unusually rich behavioral context for a mutation 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-loads the core semantics (single record, partial update) before the null warning and constraints. Dense but each sentence carries weight; the heavy capitalization is emphatic rather than wasteful, costing a little polish.

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 7-parameter mutation tool with no output schema, the description covers partial-update semantics, null handling, rename constraints, and failure handling. The only gap is that it says nothing about the shape of a successful response, though without an output schema that is a minor omission.

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?

Schema coverage is 100%, so schema alone would justify a 3. The description adds a cross-parameter operational rule not present in the schema – the conservative "do not send null unless clearing" warning – plus the coupon_code rename precondition, which meaningfully shapes how the agent fills the parameters.

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?

States a specific verb (change attributes) and a tightly scoped resource (ONE code), immediately distinguishing it from siblings like update_code_settings or create_codes. The scope word "ONE" tells the agent this is single-record, not bulk.

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?

Gives explicit operating guidance: send only the fields you want changed, do not send null unless the user asked to clear a field, and the rename precondition (unassigned and not redeemed). It does not contrast against update_code_settings, but the null-vs-omit rule is exactly the kind of when-to-do-what guidance agents need.

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