get_event_district_points
Retrieve district points for FIRST Robotics Competition teams at a specific event to track team rankings and qualification progress.
Instructions
Get district points for teams at an event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_key | Yes | Event key (e.g., 2023casj) |
Implementation Reference
- src/handlers.ts:207-219 (handler)The handler logic within the main handleToolCall switch statement. Validates input event_key, fetches district points data from The Blue Alliance API endpoint `/event/{event_key}/district_points`, parses the response using DistrictPointsSchema, and returns the JSON stringified data.case 'get_event_district_points': { const { event_key } = z.object({ event_key: EventKeySchema }).parse(args); const data = await makeApiRequest(`/event/${event_key}/district_points`); const districtPoints = DistrictPointsSchema.parse(data); return { content: [ { type: 'text', text: JSON.stringify(districtPoints, null, 2), }, ], }; }
- src/tools.ts:182-195 (registration)The tool registration entry in the exported tools array, defining the tool name, description, and JSON input schema for MCP.{ name: 'get_event_district_points', description: 'Get district points for teams at an event', inputSchema: { type: 'object', properties: { event_key: { type: 'string', description: 'Event key (e.g., 2023casj)', }, }, required: ['event_key'], }, },
- src/schemas.ts:206-226 (schema)Zod schema used for validating and parsing the output from the TBA district_points API endpoint.export const DistrictPointsSchema = z.object({ points: z.record( z.string(), z.object({ alliance_points: z.number(), award_points: z.number(), elim_points: z.number(), qual_points: z.number(), total: z.number(), }), ), tiebreakers: z .record( z.string(), z.object({ highest_qual_scores: z.array(z.number()).nullish(), qual_wins: z.number().nullish(), }), ) .nullish(), });
- src/schemas.ts:8-8 (schema)Zod schema used for input validation of the event_key parameter in the handler.export const EventKeySchema = z.string();