Skip to main content
Glama

generate_codes

Generate 1 to 5,000 unique random codes with a chosen length, character set, case, prefix and suffix. Use this when Sweeppea should invent the codes; use create_codes when the user already has them. prefix + length + suffix must not exceed 20 characters in total. NOTE: here the character set is the STRING type ("alphanumeric" or "numeric"); the same concept in update_code_settings is the INTEGER coupon_code_type (1 numeric, 2 alphanumeric). They are two encodings of one idea — do not copy a value from one tool to the other. 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
caseNoupper, lower or mixed (alphanumeric only). Defaults to upper
typeNoCharacter set. Defaults to alphanumeric. A STRING here — not the integer used by update_code_settings
valueNoApplied to every code, max 10 characters (e.g. $10, 15%)
lengthYesRandom characters per code, 4 to 20. prefix + length + suffix must not exceed 20
prefixNoLetters, digits, - or _ placed before every code
suffixNoLetters, digits, - or _ placed after every code
quantityYesHow many codes to generate, 1 to 5000
descriptionNoApplied to every code, max 5,000 characters
external_urlNohttps:// link applied to every code, max 500 characters
expiration_dateNoYYYY-MM-DD, not in the past
expiration_timeNoHH:mm, 24-hour clock
sweepstakes_tokenYesThe sweepstakes token (UUID v4) of a sweepstakes of your account

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already establish the safety profile (not read-only, not destructive, not idempotent, open-world), and the description adds genuinely non-redundant operational context: the prefix+length+suffix <= 20 constraint, the module-enablement prerequisite, and the no-retry rule on 403. It also warns against copying an encoding value across tools, which prevents a real misuse pattern.

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 purpose, then usage routing, then constraints, then the encoding gotcha and auth behavior. Every sentence carries information, but the encoding note is somewhat verbose and partially duplicates the schema's own type description.

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 12-parameter mutation tool with no output schema, it covers purpose, routing, limits, prerequisites, and error handling well. It does not describe what the response returns (created codes vs only a count), which is the main remaining gap.

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 the schema already documents each parameter (including the STRING vs INTEGER encoding note). The description still adds value by stating the combined-length ceiling over prefix+length+suffix and by flagging the cross-tool encoding trap, though it repeats some schema content.

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 (generate) and resource (unique random codes) with the exact range (1 to 5,000) and the knobs it controls. It explicitly distinguishes itself from the create_codes sibling, so an agent can route correctly without opening either schema.

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 when-to-use rule ('use this when Sweeppea should invent the codes') and names the alternative plus the condition that selects it ('create_codes when the user already has them'). It also prescribes behavior on failure (403 module not enabled -> do not retry, tell the user to contact support).

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