get_leaderboard
Retrieve the competition leaderboard from the Trading Simulator MCP Server by specifying a competition ID or using the active competition for ranking and results.
Instructions
Get the competition leaderboard
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| competitionId | No | Optional competition ID (if not provided, the active competition is used) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"competitionId": {
"description": "Optional competition ID (if not provided, the active competition is used)",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/index.ts:616-623 (handler)The main handler for the 'get_leaderboard' MCP tool. Extracts optional competitionId from input arguments and delegates to tradingClient.getLeaderboard() before formatting and returning the response.case "get_leaderboard": { const competitionId = "competitionId" in args ? args.competitionId as string : undefined; const response = await tradingClient.getLeaderboard(competitionId); return { content: [{ type: "text", text: JSON.stringify(response, null, 2) }], isError: false }; }
- src/index.ts:361-375 (schema)Tool schema definition for 'get_leaderboard', including name, description, and input schema validating optional competitionId.{ name: "get_leaderboard", description: "Get the competition leaderboard", inputSchema: { type: "object", properties: { competitionId: { type: "string", description: "Optional competition ID (if not provided, the active competition is used)" } }, additionalProperties: false, $schema: "http://json-schema.org/draft-07/schema#" } },
- src/index.ts:411-415 (registration)Registration point where the TRADING_SIM_TOOLS array (containing get_leaderboard) is returned in response to ListTools requests.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: TRADING_SIM_TOOLS }; });
- src/types.ts:277-282 (schema)TypeScript interface defining the expected response structure for leaderboard data, used by the tool handler.export interface LeaderboardResponse extends ApiResponse { competition: Competition; leaderboard: LeaderboardEntry[]; hasInactiveTeams?: boolean; }