Skip to main content
Glama

get_code

Read-onlyIdempotent

Fetch one code, either by its coupon_token, or by the code itself plus the sweepstakes_token — the second form is what a point-of-sale system has in hand. Send one form or the other: coupon_token wins if both are sent. Codes are matched exactly and case-sensitively. Read-only; it never redeems anything — use redeem_code for that. Read-only and NOT gated by the Codes & Coupons module: only the writes of this category document a module-not-enabled 403. If this call returns 403, look for another cause before telling the user the module is off.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coupon_codeNoThe code itself — up to 20 letters, digits, - or _. Matched exactly and case-sensitively. Requires sweepstakes_token
coupon_tokenNoThe code token (UUID v4). Required unless coupon_code is sent; takes precedence when both are sent
sweepstakes_tokenNoThe sweepstakes token (UUID v4). Required together with coupon_code

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 cover the safety profile, but the description adds non-obvious behavior: exact case-sensitive matching, precedence when both tokens are sent, no redemption side effect, and the module-gating caveat that only writes document a module-not-enabled 403 — a genuine operational insight.

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 two lookup forms, then constraints, then safety/routing notes. Each sentence earns its place although it runs slightly long with the 403 aside.

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?

Covers selection, precedence, matching semantics, and safety/routing for a read-only lookup where annotations already carry the safety profile. It stops short of describing the returned code shape, but with no output schema and simple semantics this is a minor 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% and the schema already states precedence and requirements, so baseline is 3. The description adds the rationale for the code+sweepstakes_token form (POS scenario) and reiterates mutual exclusivity, adding modest value beyond the schema.

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 (Fetch) and resource (one code) with two explicit lookup forms and a precedence rule. It is clearly distinguishable from siblings fetch_codes (list) and redeem_code (mutation).

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 says to send one form or the other, names the POS use case that selects the code+sweepstakes_token form, routes redemption to redeem_code, and even gives a 403 troubleshooting hint about module gating.

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