get_events_simple
Retrieve a simplified list of FIRST Robotics Competition events for a specific year using The Blue Alliance API.
Instructions
Get simplified list of events for a year
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | Competition year |
Implementation Reference
- src/handlers.ts:570-582 (handler)Handler function that validates the input year using YearSchema, fetches simplified events data from the TBA API endpoint `/events/${year}/simple`, parses the response as an array of EventSimpleSchema objects, and returns the JSON-formatted events list.case 'get_events_simple': { const { year } = z.object({ year: YearSchema }).parse(args); const data = await makeApiRequest(`/events/${year}/simple`); const events = z.array(EventSimpleSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(events, null, 2), }, ], }; }
- src/schemas.ts:379-390 (schema)Zod schema definition for EventSimple used to validate the output data from the TBA API simple events endpoint.export const EventSimpleSchema = z.object({ key: z.string(), name: z.string(), event_code: z.string(), event_type: z.number(), city: z.string().nullish(), state_prov: z.string().nullish(), country: z.string().nullish(), start_date: z.string(), end_date: z.string(), year: z.number(), });
- src/tools.ts:547-562 (registration)Tool registration object defining the name, description, and input schema for get_events_simple, which requires a year parameter.{ name: 'get_events_simple', description: 'Get simplified list of events for a year', inputSchema: { type: 'object', properties: { year: { type: 'number', description: 'Competition year', minimum: 1992, maximum: new Date().getFullYear() + 1, }, }, required: ['year'], }, },
- src/schemas.ts:10-14 (schema)Zod schema for validating the year input parameter used in the handler and matching the tool's input schema constraints.export const YearSchema = z .number() .int() .min(1992) .max(new Date().getFullYear() + 1);