Skip to main content
Glama

read.point_leaderboard

Read-onlyIdempotent

Retrieve the Arcadia Finance points leaderboard to view user rankings and scores. Supports pagination with limit and offset parameters for efficient data access.

Instructions

Get the Arcadia points leaderboard (paginated). For a specific wallet's points balance, use read.wallet.points.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax leaderboard entries to return (default 25)
offsetNoSkip first N leaderboard entries for pagination

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitYes
totalYes
offsetYes
leaderboardYes

Implementation Reference

  • The handler function for 'read.point_leaderboard' which fetches the leaderboard via the Arcadia API and returns paginated results.
    async ({ limit, offset }) => {
      try {
        const all = await api.getPointsLeaderboard();
        const list = Array.isArray(all)
          ? all
          : ((all as Record<string, unknown>).data as unknown[]);
        if (Array.isArray(list)) {
          const page = list.slice(offset, offset + limit);
          const result = { total: list.length, offset, limit, leaderboard: page };
          return {
            content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
            structuredContent: result,
          };
        }
        return {
          content: [{ type: "text" as const, text: JSON.stringify(all, null, 2) }],
          structuredContent: all as unknown as Record<string, unknown>,
        };
      } catch (err) {
        return {
          content: [
            {
              type: "text" as const,
              text: `Error: ${err instanceof Error ? err.message : String(err)}`,
            },
          ],
          isError: true,
        };
      }
    },
  • Registration of the 'read.point_leaderboard' tool within the MCP server.
    server.registerTool(
      "read.point_leaderboard",
      {
        annotations: {
          title: "Get Points Leaderboard",
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true,
        },
        description:
          "Get the Arcadia points leaderboard (paginated). For a specific wallet's points balance, use read.wallet.points.",
        inputSchema: {
          limit: z.number().default(25).describe("Max leaderboard entries to return (default 25)"),
          offset: z.number().default(0).describe("Skip first N leaderboard entries for pagination"),
        },
        outputSchema: PointsLeaderboardOutput,
      },
      async ({ limit, offset }) => {
        try {
          const all = await api.getPointsLeaderboard();
          const list = Array.isArray(all)
            ? all
            : ((all as Record<string, unknown>).data as unknown[]);
          if (Array.isArray(list)) {
            const page = list.slice(offset, offset + limit);
            const result = { total: list.length, offset, limit, leaderboard: page };
            return {
              content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
              structuredContent: result,
            };
          }
          return {
            content: [{ type: "text" as const, text: JSON.stringify(all, null, 2) }],
            structuredContent: all as unknown as Record<string, unknown>,
          };
        } catch (err) {
          return {
            content: [
              {
                type: "text" as const,
                text: `Error: ${err instanceof Error ? err.message : String(err)}`,
              },
            ],
            isError: true,
          };
        }
      },
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arcadia-finance/arcadia-finance-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server