Skip to main content
Glama

Claim Leaderboard Reward

horizon_claim_leaderboard_reward
Idempotent

Claims a player's rank reward from the previous scoring period and credits its Player Values exactly once. Use when the reward status is AVAILABLE.

Instructions

Claims the player's rank reward of the previous scoring period and credits its Player Values exactly once. Use when: horizon_get_leaderboard_reward reports status AVAILABLE. Not for: checking whether a reward exists (use horizon_get_leaderboard_reward) or changing values by hand (use horizon_adjust_player_value). Requires: userId and the player's session: sign in with horizon_signin_email or horizon_signin_anonymous and pass its accessToken as sessionToken. Side effects: Credits every value of the reward to the player's Player Values once. A repeated claim is safe: it returns alreadyClaimed true and credits nothing. The server alone decides rank and amounts from the final standings of the previous period; the client never sends them. An unclaimed reward expires when the following period ends. Returns: {reward, alreadyClaimed, playerValues}: reward is {status, period {start, end, finalAt, standingsFinal}, rank, values [{key, amount}], finalAt, claimableUntil, claimedAt}; fields that do not apply are left out. status NONE: no previous period or no rank in a reward tier. PENDING: the period ended but its standings are not final yet (see finalAt). AVAILABLE: claim it with horizon_claim_leaderboard_reward before claimableUntil. CLAIMED: already credited (claimedAt). playerValues is the player's value state after the claim, the same object horizon_get_player_values returns. Errors: 404 NO_REWARD: no previous period or no rank in a reward tier, nothing to claim. 409 REWARD_NOT_FINAL: the standings are not final yet, retry after finalAt from horizon_get_leaderboard_reward. 409 REWARD_CONFLICT: a parallel claim ran at the same moment, retrying is safe. 404 NO_PREVIOUS_PERIOD: the board has no ended period yet. 404 for an unknown leaderboardKey: list valid keys with horizon_list_leaderboards. 401 means the session is missing or expired: sign in again and retry with the new accessToken. 403 for a session means the token belongs to another user: pass the userId that signed in. 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).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "leaderboardKey": "<leaderboardKey>",
      "userId": "<userId>",
      "sessionToken": "<sessionToken>"
    },
    "name": "horizon_claim_leaderboard_reward"
  }
}

Input Schema

NameRequiredDescriptionDefault
userIdYesPlayer user ID (UUID) from horizon_signup_* or horizon_signin_*
sessionTokenYesaccessToken from horizon_signin_email or horizon_signin_anonymous for this userId; sent as a Bearer session
leaderboardKeyYesBoard key from horizon_list_leaderboards (1 to 64 characters: a-z, 0-9, _ and -). Rewards exist only on named boards

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.15.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag idempotentHint=true and destructiveHint=false, but the description goes well beyond them: it explains why repetition is safe (returns alreadyClaimed true, credits nothing), that the server alone computes rank and amounts, and that an unclaimed reward expires when the following period ends. It also documents auth failure modes (401/403/429) and the isError error-result shape.

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 cleanly labeled blocks (Use when / Not for / Requires / Side effects / Returns / Errors) that make it skimmable. It is long, and the error enumeration includes generic cases (429 rate limit, 401 API-key confusion) that inflate length, but almost every line is decision-relevant for a mutation with many failure codes.

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 and four distinct error states, the description carries the full burden and does: it enumerates reward statuses (NONE/PENDING/AVAILABLE/CLAIMED), the return shape, the expiration window, and each error code with the recovery action. Nothing an agent needs to call this correctly or interpret failure is missing.

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 explains all three parameters; baseline would be 3. The description adds meaning beyond it by tying sessionToken to a prior signin and stating that a 403 means the token belongs to a different user, and by pointing at horizon_list_leaderboards for valid leaderboardKey values ('rewards exist only on named boards').

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?

Opens with a specific verb+resource+effect: 'Claims the player's rank reward of the previous scoring period and credits its Player Values exactly once.' That precisely distinguishes it from horizon_get_leaderboard_reward (read) and horizon_adjust_player_value (manual change), both named in the same definition.

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?

Explicit when-to-use ('Use when: horizon_get_leaderboard_reward reports status AVAILABLE') and explicit when-not ('Not for: checking whether a reward exists ... or changing values by hand'), each paired with the correct alternative tool. Prerequisites (signin flow, accessToken as sessionToken) and the retry conditions are also stated.

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