get_team_events
Retrieve FRC team-event records with filters for team, year, event, country, state, district, type, and week. Sort and paginate results to analyze team performance across events.
Instructions
List FIRST Robotics Competition (FRC) team-event records with flexible filters. Each row represents one team's performance at one event (rank, record, EPA, awards). Filter any combination of team (one team across all events), year, event (all teams at one event - great for getting an event's full team list with stats), country, state, district, type (regional, district, district_cmp, champs_div, einstein, offseason), and week (0-8). Sort with metric/ascending and paginate with limit/offset. Use this to answer "show every event team 254 has attended in 2024", "list all teams at 2024flor with their ranks", or "rank teams by EPA across all 2024 district championships".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team | No | Team number (no prefix), e.g. 86 | |
| year | No | Four-digit year (2002 onwards) | |
| event | No | Event key, e.g. 2024flor | |
| country | No | Capitalized country name, e.g. USA or Canada. | |
| state | No | Capitalized two-letter state code, e.g. NC. | |
| district | No | District abbreviation. One of: ca, fch, fim, fin, fit, fma, fnc, fsc, isr, ne, ont, pch, pnw, win. | |
| type | No | One of: regional, district, district_cmp, champs_div, einstein, or offseason. | |
| week | No | Week of the competition season. 8 is CMP. | |
| metric | No | How to sort the returned values. Any column in the table is valid. | |
| ascending | No | Whether to sort in ascending order. Default is ascending. | |
| limit | No | Maximum number of results to return (1-1000). Default is 1000. | |
| offset | No | Offset from the first result to return. |
Implementation Reference
- src/handlers.ts:175-208 (handler)The handler for 'get_team_events' in the switch statement. It parses args using GetTeamEventsInputSchema, builds a query string from the parsed fields (team, year, event, country, state, district, type, week, metric, ascending, limit, offset), makes a GET request to /v3/team_events with that query string, and returns the JSON result.
case 'get_team_events': { const { team, year, event, country, state, district, type, week, metric, ascending, limit, offset, } = GetTeamEventsInputSchema.parse(args); const qs = buildQueryString({ team, year, event, country, state, district, type, week, metric, ascending, limit, offset, }); const data = await makeApiRequest(`/v3/team_events${qs}`); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }], }; } - src/schemas.ts:156-168 (schema)The Zod input schema for 'get_team_events'. Defines optional fields: team (integer), year (2002+), event (string like '2024flor'), country, state, district, type (event type), week (0-8), plus pagination/sorting fields (metric, ascending, limit, offset).
export const GetTeamEventsInputSchema = z.object({ team: TeamNumberSchema.optional().describe( 'Team number (no prefix), e.g. 86', ), year: YearSchema.optional().describe('Four-digit year (2002 onwards)'), event: EventKeySchema.optional().describe('Event key, e.g. 2024flor'), country: CountrySchema, state: StateSchema, district: DistrictSchema, type: EventTypeSchema, week: WeekSchema, ...PaginationSortFields, }); - src/tools.ts:187-203 (registration)The tool registration definition for 'get_team_events'. Declares the tool name, human-readable description explaining usage and filters, annotations marking it read-only/idempotent, and associates it with GetTeamEventsInputSchema for input validation.
{ name: 'get_team_events', description: 'List FIRST Robotics Competition (FRC) team-event records with flexible filters. Each row represents ' + "one team's performance at one event (rank, record, EPA, awards). " + 'Filter any combination of `team` (one team across all events), `year`, `event` (all teams at one event - ' + "great for getting an event's full team list with stats), `country`, `state`, `district`, " + '`type` (regional, district, district_cmp, champs_div, einstein, offseason), and `week` (0-8). ' + 'Sort with `metric`/`ascending` and paginate with `limit`/`offset`. ' + 'Use this to answer "show every event team 254 has attended in 2024", "list all teams at 2024flor with their ranks", ' + 'or "rank teams by EPA across all 2024 district championships".', annotations: { title: 'List/Search FRC Team-Event Records', ...readOnlyAnnotations, }, inputSchema: toMCPSchema(GetTeamEventsInputSchema), },