get_team_years_participated
Retrieve the competition years a specific FRC team has participated in using The Blue Alliance API. Provide the team key in frcXXXX format to get historical participation data.
Instructions
Get years that a team has participated in competition
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team_key | Yes | Team key in format frcXXXX (e.g., frc86) |
Implementation Reference
- src/handlers.ts:221-233 (handler)The main handler logic for the 'get_team_years_participated' tool. It validates the input args using TeamKeySchema, makes an API request to The Blue Alliance for the team's years participated, parses the response as an array of numbers, and returns it as a JSON string in the tool response format.case 'get_team_years_participated': { const { team_key } = z.object({ team_key: TeamKeySchema }).parse(args); const data = await makeApiRequest(`/team/${team_key}/years_participated`); const years = z.array(z.number()).parse(data); return { content: [ { type: 'text', text: JSON.stringify(years, null, 2), }, ], }; }
- src/tools.ts:196-210 (registration)The tool registration entry in the exported tools array, defining the name, description, and input schema for 'get_team_years_participated'. This is used by the MCP server to list available tools.{ name: 'get_team_years_participated', description: 'Get years that a team has participated in competition', inputSchema: { type: 'object', properties: { team_key: { type: 'string', description: 'Team key in format frcXXXX (e.g., frc86)', pattern: '^frc\\d+$', }, }, required: ['team_key'], }, },
- src/schemas.ts:4-6 (schema)Zod schema for validating team_key input (format frcXXXX), imported and used in the handler for input parsing.export const TeamKeySchema = z .string() .regex(/^frc\d+$/, 'Team key must be in format frcXXXX');