Skip to main content
Glama

Get Leaderboard Around User

horizon_get_leaderboard_around
Read-onlyIdempotent

Fetch the leaderboard entries directly above and below a player's position to show local rivals, including the player and each profile.

Instructions

Returns the leaderboard entries directly above and below a player's own position, including the player, each with profile. Use when: a game shows 'you and your rivals' instead of the global top. Not for: the global top list (use horizon_get_leaderboard_top) or the position alone (use horizon_get_user_rank). Requires: a userId from horizon_signup_* or horizon_signin_*; no session token. Side effects: None (read only). Returns: {entries: [{position, username, score, profile}]} in board order. profile is {avatarId, frameId, badges} (IDs from the cosmetics catalog; null or [] when not set, set with horizon_set_profile). Errors: 404 for an unknown leaderboardKey: list valid keys with horizon_list_leaderboards. 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
rangeNoHow many entries around the player to return, 1 to 50 (default 10)
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
entriesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 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 / range / description
      Previous value: -"Number of entries around the user (1-50, default 10)"New value: +"How many entries around the player to return, 1 to 50 (default 10)"
    • 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": {
      +    "entries": {
      +      "anyOf": [
      +        {
      +          "description": "Leaderboard entries in board order",
      +          "items": {
      +            "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"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  2. 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"
  3. First observedv1.5.4

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=true, so safety is covered structurally. The description adds useful non-annotation context: no session token required, the userId provenance, error semantics (404/401/429 with the 429 rate-limit wait-and-retry instruction), and the isError behavior. That said, much of the return-shape detail is redundant with the existing output schema, so it does not reach the top of the range.

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-load the scope before the alternative routing. It is slightly long, and the Returns block partially duplicates the output schema, but no sentence is wasted.

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?

Given a read-only tool with a full schema and an output schema, the definition still covers prerequisites (userId, no session token), auth (HORIZON_API_KEY), error handling and rate-limit recovery, and the sibling routing needed to call it correctly. Nothing an agent needs is missing.

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 all three parameters (range, userId, leaderboardKey) are already documented, including UUID format and the leaderboardKey pattern/default. The description echoes the userId source and leaderboardKey default rather than adding new semantics beyond the schema, so the baseline 3 applies.

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 ('returns the leaderboard entries directly above and below a player's own position') and immediately distinguishes itself from horizon_get_leaderboard_top and horizon_get_user_rank. An agent can identify the exact scope without opening the schema.

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 'Use when' gives the triggering scenario ('you and your rivals' UI) and 'Not for' names both alternative siblings with the condition that selects each. Nothing 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