Skip to main content
Glama

Validate Gift Code

horizon_validate_gift_code
Read-onlyIdempotent

Checks whether a gift code is currently valid for a player without consuming it or preparing a redemption.

Instructions

Checks whether a gift code is currently valid for a player without consuming or preparing it. Use when: showing an early validity message; horizon_prepare_gift_code prepares a consumable V2 identity. Not for: claiming rewards (use horizon_redeem_gift_code with an already persisted intent). Requires: userId from horizon_signup_* or horizon_signin_*; no session token. Side effects: None (read only). Returns: {valid}; a validity check reserves nothing and cannot recover an uncertain redemption. Errors: Needs HORIZON_API_KEY. Every failure returns an error result (isError) with the HTTP status and body: a 401 that horizon_test_connection also returns means HORIZON_API_KEY is wrong, 429 means the account's per-minute rate limit was reached (wait a minute, then retry).

Input Schema

NameRequiredDescriptionDefault
codeYesOriginal visible gift code, retained with the prepared campaign identity
userIdYesPlayer user ID (UUID) from horizon_signup_* or horizon_signin_*

Output Schema

NameRequiredDescriptionDefault
validNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.9.1
    • changedInput schema / properties / code / description
      Previous value: -"Gift code as the player typed it (max 50 characters)"New value: +"Original visible gift code, retained with the prepared campaign identity"
  2. Changed4 schema fields changedv1.6.0
    • changedInput schema / properties / code / description
      Previous value: -"Gift code to validate (max 50 characters)"New value: +"Gift code as the player typed it (max 50 characters)"
    • addedInput schema / properties / code / minLength
      Added value: +1
    • changedInput schema / properties / userId / description
      Previous value: -"User ID (UUID) returned by a horizon_signup_* or horizon_signin_* tool"New value: +"Player user ID (UUID) from horizon_signup_* or horizon_signin_*"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "valid": {
      +      "anyOf": [
      +        {
      +          "description": "true when the player can redeem the code now",
      +          "type": "boolean"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  3. Changed1 schema field changedv1.5.5
    • changedInput schema / properties / userId / description
      Previous value: -"User ID (UUID)"New value: +"User ID (UUID) returned by a horizon_signup_* or horizon_signin_* tool"
  4. First observedv1.5.4

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive, but the description goes further: reserves nothing, cannot recover an uncertain redemption, requires HORIZON_API_KEY, and no session token. It also maps specific error outcomes (401 vs 429) to causes and remedies, which annotations cannot express.

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?

Labeled sections (Use when / Not for / Requires / Side effects / Returns / Errors) make it scannable and front-loaded. Slightly heavy on error prose and mildly redundant with 'None (read only)' given readOnlyHint, but every line still carries actionable content.

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?

For a two-param read tool with full schema coverage and an output schema, nothing essential is missing: auth prerequisite, side-effect profile, return shape, and error handling are all covered. The description need not re-explain the return object since an output schema exists.

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 coverage is 100% and both params are documented in the schema, so the baseline of 3 applies. The 'Requires userId from horizon_signup_*' line reinforces provenance but largely restates the schema's own userId description without adding format or constraint 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 (checks validity) and resource (gift code), and explicitly delimits scope: it does not consume or prepare the code. This unmistakably distinguishes it from horizon_prepare_gift_code and horizon_redeem_gift_code, both named in the text.

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?

Provides explicit 'Use when' (early validity message) and 'Not for' (claiming rewards) clauses, each routed to the correct sibling. An agent can choose between validate/prepare/redeem without opening any schema.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools