get_district_rankings
Retrieve team rankings for a specific FIRST Robotics Competition district to analyze competitive standings and performance metrics.
Instructions
Get team rankings within a district
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| district_key | Yes | District key (e.g., 2023fim) |
Implementation Reference
- src/handlers.ts:437-451 (handler)The main handler logic for the 'get_district_rankings' tool. It validates the input district_key, fetches rankings from the TBA API endpoint `/district/${district_key}/rankings`, parses the response using DistrictRankingSchema array, and returns the JSON stringified data.case 'get_district_rankings': { const { district_key } = z .object({ district_key: z.string() }) .parse(args); const data = await makeApiRequest(`/district/${district_key}/rankings`); const rankings = z.array(DistrictRankingSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(rankings, null, 2), }, ], }; }
- src/tools.ts:411-424 (registration)Tool registration in the exported tools array, defining the name, description, and input schema for MCP tool discovery.{ name: 'get_district_rankings', description: 'Get team rankings within a district', inputSchema: { type: 'object', properties: { district_key: { type: 'string', description: 'District key (e.g., 2023fim)', }, }, required: ['district_key'], }, },
- src/schemas.ts:351-367 (schema)Zod schema definition for individual district ranking objects, used to parse the API response array in the handler.export const DistrictRankingSchema = z.object({ team_key: z.string(), rank: z.number(), rookie_bonus: z.number().nullish(), point_total: z.number(), event_points: z.array( z.object({ district_cmp: z.boolean(), total: z.number(), alliance_points: z.number(), elim_points: z.number(), award_points: z.number(), event_key: z.string(), qual_points: z.number(), }), ), });