get_team_events_keys
Retrieve event keys for a specific FRC team in a given competition year using The Blue Alliance API.
Instructions
Get event keys for a team in a specific year
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team_key | Yes | Team key in format frcXXXX (e.g., frc86) | |
| year | Yes | Competition year |
Implementation Reference
- src/handlers.ts:633-652 (handler)The handler case in the switch statement that executes the get_team_events_keys tool: validates input using Zod schemas, calls the TBA API to retrieve event keys for a team in a given year, parses the array of strings, and returns it as formatted JSON text content.case 'get_team_events_keys': { const { team_key, year } = z .object({ team_key: TeamKeySchema, year: YearSchema, }) .parse(args); const data = await makeApiRequest( `/team/${team_key}/events/${year}/keys`, ); const keys = z.array(z.string()).parse(data); return { content: [ { type: 'text', text: JSON.stringify(keys, null, 2), }, ], }; }
- src/tools.ts:615-634 (registration)The tool registration object in the tools array exported from tools.ts, which includes the name, description, and inputSchema. This array is used by index.ts to register tools with the MCP server.name: 'get_team_events_keys', description: 'Get event keys for a team in a specific year', inputSchema: { type: 'object', properties: { team_key: { type: 'string', description: 'Team key in format frcXXXX (e.g., frc86)', pattern: '^frc\\d+$', }, year: { type: 'number', description: 'Competition year', minimum: 1992, maximum: new Date().getFullYear() + 1, }, }, required: ['team_key', 'year'], }, },
- src/schemas.ts:4-6 (schema)Zod schema for team_key validation used in the handler's input parsing.export const TeamKeySchema = z .string() .regex(/^frc\d+$/, 'Team key must be in format frcXXXX');
- src/schemas.ts:10-14 (schema)Zod schema for year validation used in the handler's input parsing.export const YearSchema = z .number() .int() .min(1992) .max(new Date().getFullYear() + 1);