get_event_matches
Retrieve match data for FIRST Robotics Competition events using event keys to access schedules, results, and team performance information.
Instructions
Get matches for a specific event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_key | Yes | Event key (e.g., 2023casj) |
Implementation Reference
- src/handlers.ts:165-177 (handler)The handler case for 'get_event_matches' in the main switch statement of handleToolCall. Validates the event_key argument, fetches match data from the TBA API, parses it, and returns the JSON-formatted matches.case 'get_event_matches': { const { event_key } = z.object({ event_key: EventKeySchema }).parse(args); const data = await makeApiRequest(`/event/${event_key}/matches`); const matches = z.array(MatchSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(matches, null, 2), }, ], }; }
- src/tools.ts:140-153 (registration)Tool object in the exported tools array, registering 'get_event_matches' with its description and input schema for MCP tool listing.{ name: 'get_event_matches', description: 'Get matches for a specific event', inputSchema: { type: 'object', properties: { event_key: { type: 'string', description: 'Event key (e.g., 2023casj)', }, }, required: ['event_key'], }, },
- src/schemas.ts:8-8 (schema)Zod schema definition for EventKeySchema used to validate the event_key input in the handler.export const EventKeySchema = z.string();
- src/schemas.ts:87-121 (schema)Zod schema definition for MatchSchema used to validate the array of matches in the API response within the handler.export const MatchSchema = z.object({ key: z.string(), comp_level: z.string(), set_number: z.number(), match_number: z.number(), alliances: z.object({ red: z.object({ score: z.number(), team_keys: z.array(z.string()), surrogate_team_keys: z.array(z.string()).nullish(), dq_team_keys: z.array(z.string()).nullish(), }), blue: z.object({ score: z.number(), team_keys: z.array(z.string()), surrogate_team_keys: z.array(z.string()).nullish(), dq_team_keys: z.array(z.string()).nullish(), }), }), winning_alliance: z.string().nullish(), event_key: z.string(), time: z.number().nullish(), actual_time: z.number().nullish(), predicted_time: z.number().nullish(), post_result_time: z.number().nullish(), score_breakdown: z.record(z.string(), z.any()).nullish(), videos: z .array( z.object({ type: z.string(), key: z.string(), }), ) .nullish(), });