get_team_matches_simple
Retrieve simplified match data for a specific FIRST Robotics Competition team in a given year using The Blue Alliance API.
Instructions
Get simplified matches 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:675-694 (handler)The handler case in handleToolCall that validates input parameters (team_key and year), fetches simplified match data for the team in the specified year from the TBA API using makeApiRequest, parses the response with Zod's array of MatchSimpleSchema, and returns the JSON stringified data.case 'get_team_matches_simple': { const { team_key, year } = z .object({ team_key: TeamKeySchema, year: YearSchema, }) .parse(args); const data = await makeApiRequest( `/team/${team_key}/matches/${year}/simple`, ); const matches = z.array(MatchSimpleSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(matches, null, 2), }, ], }; }
- src/tools.ts:654-674 (registration)Tool registration object in the exported tools array, defining the name, description, and JSON input schema for MCP tool listing.{ name: 'get_team_matches_simple', description: 'Get simplified matches 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:392-412 (schema)Zod schema definition for a simple match object, used to validate the API response data 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:4-6 (schema)Zod schema for validating team_key input parameter.export const TeamKeySchema = z .string() .regex(/^frc\d+$/, 'Team key must be in format frcXXXX');
- src/schemas.ts:10-14 (schema)Zod schema for validating year input parameter.export const YearSchema = z .number() .int() .min(1992) .max(new Date().getFullYear() + 1);