Skip to main content
Glama

fetch_codes

Read-onlyIdempotent

One page of a sweepstakes codes, with the participant each code is assigned to. Filtering, search and sorting all happen server-side — use filter and search rather than pulling every page and filtering yourself. Defaults to 25 per page, maximum 500. available means not redeemed AND not assigned. For a plain count use fetch_code_stats instead, it is far cheaper. 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
pageNoPage number, starting at 1. Defaults to 1
filterNoWhich codes to return. Defaults to all. available = not redeemed and not assigned
searchNoPart of a code, or of the email / phone of the assigned participant (case-insensitive, max 100 characters)
sort_byNoSort field. Defaults to CreationDate, newest first
sort_descNotrue for descending order (applies with sort_by)
items_per_pageNoResults per page, 1 to 500. Defaults to 25
sweepstakes_tokenYesThe sweepstakes token (UUID v4) of a sweepstakes of your account

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already cover readOnly/idempotent/non-destructive, so the safety profile is pre-declared; the description adds real value with pagination defaults and the module-gating nuance (403 here is not a Codes & Coupons module error, so look for another cause before reporting the module off). It stops short of describing return shape or pagination termination behavior, so it is solid but not exceptional beyond annotations.

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 and packed with signal — server-side filtering, page-size bounds, filter semantics, and the cheaper count alternative — with no filler sentences. It is a dense single paragraph rather than cleanly separated guidance, which keeps it just short of ideal structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema the description compensates by describing the returned content (a page of codes plus assigned participant), and annotations carry the safety profile. Combined with 100% parameter schema coverage and explicit routing to fetch_code_stats, an agent has everything needed to call this correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter already carries its own description and enum docs; the baseline is 3. The description's 'available means not redeemed AND not assigned' and 'Defaults to 25 per page, maximum 500' restate what the schema already says, adding no new syntax or format detail.

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 and resource ('One page of a sweepstakes codes, with the participant each code is assigned to'), including the scope (paginated) and the joined participant data. It is immediately distinguishable from singular siblings like get_code, write siblings like create_codes, and aggregate sibling fetch_code_stats.

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 tells the agent to filter and search server-side rather than paginating and filtering client-side, and names fetch_code_stats as the cheaper alternative for a plain count. Both when-to-use and a named alternative with rationale are present.

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