get_team_event_matches
Retrieve match data for a specific FIRST Robotics Competition team at a particular event using The Blue Alliance API.
Instructions
Get matches for a team at a specific event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team_key | Yes | Team key in format frcXXXX (e.g., frc86) | |
| event_key | Yes | Event key (e.g., 2023casj) |
Implementation Reference
- src/handlers.ts:282-301 (handler)Handler implementation for get_team_event_matches: validates team_key and event_key, fetches matches from TBA API /team/{team_key}/event/{event_key}/matches, parses with MatchSchema, returns JSON string.case 'get_team_event_matches': { const { team_key, event_key } = z .object({ team_key: TeamKeySchema, event_key: EventKeySchema, }) .parse(args); const data = await makeApiRequest( `/team/${team_key}/event/${event_key}/matches`, ); const matches = z.array(MatchSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(matches, null, 2), }, ], }; }
- src/tools.ts:262-280 (registration)Tool registration in the exported tools array: defines name, description, and inputSchema for MCP tool list.{ name: 'get_team_event_matches', description: 'Get matches for a team at a specific event', inputSchema: { type: 'object', properties: { team_key: { type: 'string', description: 'Team key in format frcXXXX (e.g., frc86)', pattern: '^frc\\d+$', }, event_key: { type: 'string', description: 'Event key (e.g., 2023casj)', }, }, required: ['team_key', 'event_key'], }, },
- src/schemas.ts:4-8 (schema)Zod schemas for input validation: TeamKeySchema and EventKeySchema used in the handler.export const TeamKeySchema = z .string() .regex(/^frc\d+$/, 'Team key must be in format frcXXXX'); export const EventKeySchema = z.string();
- src/schemas.ts:87-121 (schema)Zod schema for output parsing: MatchSchema used to validate the array of matches returned by the API.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(), });