Skip to main content
Glama

Get User Rank

horizon_get_user_rank
Read-onlyIdempotent

Retrieves a player's own leaderboard position, score, and profile by userId, so you can show their rank after score submission or display 'your rank' in the game.

Instructions

Returns one player's own position, score and profile on a leaderboard. Use when: after horizon_submit_score, or to show 'your rank' in the game. Not for: a list of entries (use horizon_get_leaderboard_top or horizon_get_leaderboard_around). Requires: a userId from horizon_signup_* or horizon_signin_*; no session token. Side effects: None (read only). Returns: {position, username, score, profile}. profile is {avatarId, frameId, badges} (IDs from the cosmetics catalog; null or [] when not set, set with horizon_set_profile). On boards with a schedule the result also carries period {start, end} (ISO-8601, UTC) and equal scores share a rank (1, 1, 3). Errors: 404 when the player has no score on this board (or in the chosen period) yet (submit one first) or the leaderboardKey is unknown (check horizon_list_leaderboards). 404 NO_PREVIOUS_PERIOD for period previous when the board has no ended period yet: read the current period instead. 400 for any other period value. 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": {
      "userId": "<userId>"
    },
    "name": "horizon_get_user_rank"
  }
}

Input Schema

NameRequiredDescriptionDefault
periodNoScoring period to read: current (default) or previous (the period that ended last, on boards with a weekly or monthly schedule). Needs leaderboardKey
userIdYesPlayer user ID (UUID) from horizon_signup_* or horizon_signin_*
leaderboardKeyNoBoard key from horizon_list_leaderboards (1 to 64 characters: a-z, 0-9, _ and -). Omit to use the API key's default board.

Output Schema

NameRequiredDescriptionDefault
scoreNo
periodNo
profileNo
positionNo
usernameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.15.0
    • addedInput schema / properties / period
      Added value: +{
      +  "description": "Scoring period to read: current (default) or previous (the period that ended last, on boards with a weekly or monthly schedule). Needs leaderboardKey",
      +  "enum": [
      +    "current",
      +    "previous"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / period
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": {},
      +      "description": "The scoring period the entries belong to",
      +      "properties": {
      +        "end": {
      +          "anyOf": [
      +            {
      +              "description": "Period end (ISO-8601, UTC); null when it has no end",
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        },
      +        "start": {
      +          "anyOf": [
      +            {
      +              "description": "Period start (ISO-8601, UTC); null since the schedule began",
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
  2. Changed3 schema fields changedv1.6.0
    • changedInput schema / properties / leaderboardKey / description
      Previous value: -"Leaderboard key — selects a named board on the API key. Omit to use the default board."New value: +"Board key from horizon_list_leaderboards (1 to 64 characters: a-z, 0-9, _ and -). Omit to use the API key's default board."
    • 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": {
      +    "position": {
      +      "anyOf": [
      +        {
      +          "description": "1-based position on the board",
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "profile": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {},
      +          "description": "The player's displayed cosmetics",
      +          "properties": {
      +            "avatarId": {
      +              "anyOf": [
      +                {
      +                  "description": "Avatar cosmetic ID, null when not set",
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "badges": {
      +              "anyOf": [
      +                {
      +                  "description": "Displayed badge cosmetic IDs (0 to 3)",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            },
      +            "frameId": {
      +              "anyOf": [
      +                {
      +                  "description": "Frame cosmetic ID, null when not set",
      +                  "type": "string"
      +                },
      +                {
      +                  "type": "null"
      +                }
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "score": {
      +      "anyOf": [
      +        {
      +          "description": "Best score of the player on this board",
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "username": {
      +      "anyOf": [
      +        {
      +          "description": "Player display name",
      +          "type": "string"
      +        },
      +        {
      +          "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.8/5.0
Behavior5/5

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

Beyond the readOnlyHint/destructiveHint annotations, it states 'Side effects: None (read only)', the auth requirement (HORIZON_API_KEY, no session token), the per-minute 429 rate limit and the retry advice. It also documents error semantics that annotations cannot carry: 404 for a player with no score, 404 NO_PREVIOUS_PERIOD for 'previous' on a board with no ended period, and 400 for any other period value.

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?

The labeled Use when / Not for / Requires / Side effects / Returns / Errors structure makes a dense definition scannable, and the routing information is front-loaded. It is longer than typical, and the Returns block partly duplicates the existing output schema, but each section carries distinct information.

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 three-parameter read tool with an output schema, annotations and full schema coverage, the definition covers selection, prerequisites, return shape, period/tie semantics and every failure mode. An agent has everything needed to call it and interpret the result correctly.

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 already 100%, so the baseline is 3; the description adds real meaning on top by tying 'period' to its error cases and tie-ranking behavior (equal scores share a rank, 1/1/3) and tying leaderboardKey to the 404 path and horizon_list_leaderboards. It stops short of adding syntax or default details the schema doesn't already hold.

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?

The first sentence gives a specific verb and resource: returns one player's own position, score and profile on a leaderboard. It immediately distinguishes itself from the list-style siblings by naming horizon_get_leaderboard_top and horizon_get_leaderboard_around as the alternatives.

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?

The 'Use when' line ties the tool to a concrete moment (after horizon_submit_score, or a 'your rank' display), and the 'Not for' line routes the agent to the correct sibling for entry lists. Nothing about when to select this tool is left to inference.

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