Skip to main content
Glama

Get Leaderboard Top

horizon_get_leaderboard_top
Read-onlyIdempotent

Fetches top leaderboard entries with player profiles for displaying global top lists, and appends the requesting player's own entry when they are not in the top.

Instructions

Returns the top entries of a leaderboard from position 1, each with the player's profile, plus the requesting player's own entry when they are outside the list. Use when: a game shows a global top list (top 10, top 100). Not for: one player's position alone (use horizon_get_user_rank) or the players around them (use horizon_get_leaderboard_around). Requires: a userId from horizon_signup_* or horizon_signin_* (used to append the player's own entry); no session token. Side effects: None (read only). Returns: {entries: [{position, username, score, profile}]} in board order. When the userId is not among them, the player's own entry with the real position is added at the end. An empty board returns an empty list. 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
limitNoNumber of top entries to return, 1 to 100 (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 / limit / description
      Previous value: -"Number of top entries to return (1-100, default 10)"New value: +"Number of top entries to return, 1 to 100 (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.7/5.0
Behavior5/5

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

Goes well beyond annotations: discloses the self-entry append behavior when the userId is outside the list, empty-board behavior, 404/401/429 error semantics with remediation, the HORIZON_API_KEY requirement, and 'no session token'. The read-only claim aligns with readOnlyHint.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with a labeled structure (Use when / Not for / Requires / Side effects / Returns / Errors) that makes scanning trivial. Every sentence carries operational value with no filler.

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?

Covers return shape, edge cases (empty board, self-entry), auth prerequisites, and error taxonomy including cross-tool 401 comparison. Despite an output schema existing, the extra edge-case detail is warranted and complete for correct invocation.

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 userId and leaderboardKey carry full descriptions including UUID format, defaults, and the 'omit to use the API key's default board' fallback. The description largely defers to the schema, which is the right call here, so 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+resource ('Returns the top entries of a leaderboard from position 1') and explicitly distinguishes from siblings horizon_get_user_rank and horizon_get_leaderboard_around. An agent can pick the right tool without opening any 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' (global top list, top 10/top 100) and 'Not for' clauses naming the two alternative tools and their selecting conditions. 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