get_event_matches_simple
Retrieve simplified match data for FIRST Robotics Competition events to analyze team performance and event outcomes.
Instructions
Get simplified matches for an event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_key | Yes | Event key (e.g., 2023casj) |
Implementation Reference
- src/handlers.ts:802-814 (handler)The core handler logic for the 'get_event_matches_simple' tool. It validates the input event_key using EventKeySchema, fetches simplified match data from the TBA API endpoint `/event/{event_key}/matches/simple`, parses the response using an array of MatchSimpleSchema, and returns the matches as a formatted JSON text response.case 'get_event_matches_simple': { const { event_key } = z.object({ event_key: EventKeySchema }).parse(args); const data = await makeApiRequest(`/event/${event_key}/matches/simple`); const matches = z.array(MatchSimpleSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(matches, null, 2), }, ], }; }
- src/tools.ts:784-796 (registration)Tool registration in the exported tools array used by the MCP server. Defines the tool name, description, and input schema for validation by the MCP framework.name: 'get_event_matches_simple', description: 'Get simplified matches for an event', inputSchema: { type: 'object', properties: { event_key: { type: 'string', description: 'Event key (e.g., 2023casj)', }, }, required: ['event_key'], }, },
- src/schemas.ts:392-412 (schema)Zod schema definition for MatchSimple objects, used to validate the array of matches returned from the TBA API in the handler.export const MatchSimpleSchema = 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()), }), blue: z.object({ score: z.number(), team_keys: z.array(z.string()), }), }), winning_alliance: z.string().nullish(), event_key: z.string(), time: z.number().nullish(), predicted_time: z.number().nullish(), actual_time: z.number().nullish(), });
- src/schemas.ts:8-9 (schema)Zod schema for event_key input validation, used in the handler to parse tool arguments.export const EventKeySchema = z.string();