Claim Leaderboard Reward
horizon_claim_leaderboard_rewardClaims 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
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | Player user ID (UUID) from horizon_signup_* or horizon_signin_* | |
| sessionToken | Yes | accessToken from horizon_signin_email or horizon_signin_anonymous for this userId; sent as a Bearer session | |
| leaderboardKey | Yes | Board key from horizon_list_leaderboards (1 to 64 characters: a-z, 0-9, _ and -). Rewards exist only on named boards |