get_leaderboard
Retrieve competition rankings to track performance and compare results in the Trading Simulator.
Instructions
Get the competition leaderboard
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_leaderboard"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| competitionId | No | Optional competition ID (if not provided, the active competition is used) |
Implementation Reference
- src/index.ts:361-375 (registration)Registration of the 'get_leaderboard' tool in the TRADING_SIM_TOOLS array, including name, description, and input schema.
{ 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:616-623 (handler)MCP tool handler for 'get_leaderboard' in the CallToolRequestSchema switch statement. Extracts competitionId from arguments and calls tradingClient.getLeaderboard().
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:364-373 (schema)Input schema definition for the 'get_leaderboard' tool, specifying optional competitionId parameter.
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/api-client.ts:549-561 (helper)Implementation of getLeaderboard method in TradingSimulatorClient class, which makes the actual API request to /api/competition/leaderboard.
async getLeaderboard(competitionId?: string): Promise<LeaderboardResponse | ErrorResponse> { let query = ''; if (competitionId) { query = `?competitionId=${encodeURIComponent(competitionId)}`; } return this.request<LeaderboardResponse>( 'GET', `/api/competition/leaderboard${query}`, null, 'get leaderboard' ); }