get_team_awards
Retrieve awards won by a FIRST Robotics Competition team in a specific year using The Blue Alliance API. Input team key (frcXXXX) and year to access competition achievements.
Instructions
Get awards won by 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:71-88 (handler)Executes the get_team_awards tool: parses team_key and year, fetches awards from TBA API, validates with AwardSchema, returns JSON stringified response.case 'get_team_awards': { const { team_key, year } = z .object({ team_key: TeamKeySchema, year: YearSchema, }) .parse(args); const data = await makeApiRequest(`/team/${team_key}/awards/${year}`); const awards = z.array(AwardSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(awards, null, 2), }, ], }; }
- src/tools.ts:40-60 (registration)Registers the get_team_awards tool in the MCP tools list with name, description, and input schema validation.{ name: 'get_team_awards', description: 'Get awards won by 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:123-134 (schema)Zod schema defining the structure of award objects returned by the TBA API for team awards.export const AwardSchema = z.object({ name: z.string(), award_type: z.number(), event_key: z.string(), recipient_list: z.array( z.object({ team_key: z.string().nullish(), awardee: z.string().nullish(), }), ), year: z.number(), });
- src/schemas.ts:10-14 (schema)Zod schema for validating the year parameter (input).export const YearSchema = z .number() .int() .min(1992) .max(new Date().getFullYear() + 1);
- src/schemas.ts:4-6 (schema)Zod schema for validating the team_key parameter (input).export const TeamKeySchema = z .string() .regex(/^frc\d+$/, 'Team key must be in format frcXXXX');