get_teams
List FRC teams with filters by country, state, district, and active status. Sort by metrics like EPA or win rate, and paginate results to find top teams.
Instructions
List FIRST Robotics Competition (FRC) teams from the Statbotics database with optional filters. Returns an array of team profiles (number, name, location, rookie year, active flag, career EPA stats, career win rate). Filter by country (e.g. "USA", "Canada"), state (two-letter code, e.g. "NC", "CA"), district (one of ca, fch, fim, fin, fit, fma, fnc, fsc, isr, ne, ont, pch, pnw, win), and active (true to limit to teams that competed in the last year). Sort with metric/ascending (e.g. metric="norm_epa", ascending=false to find the strongest active teams) and paginate with limit/offset. Use this to answer "which teams in Texas are most successful?", "list all teams in the FIM district", or "find the top 50 teams by normalized EPA".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. | |
| active | No | Whether the team has played in the last year. | |
| 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:64-89 (handler)The handler for 'get_teams' tool. Parses input (country, state, district, active, metric, ascending, limit, offset) using GetTeamsInputSchema, builds a query string from the parsed params, and makes an API GET request to /v3/teams with the query string.
case 'get_teams': { const { country, state, district, active, metric, ascending, limit, offset, } = GetTeamsInputSchema.parse(args); const qs = buildQueryString({ country, state, district, active, metric, ascending, limit, offset, }); const data = await makeApiRequest(`/v3/teams${qs}`); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }], }; } - src/schemas.ts:113-119 (schema)Zod schema for get_teams input validation. Defines optional fields: country (string), state (string), district (string), active (boolean), plus pagination/sorting fields (metric, ascending, limit, offset).
export const GetTeamsInputSchema = z.object({ country: CountrySchema, state: StateSchema, district: DistrictSchema, active: ActiveSchema, ...PaginationSortFields, }); - src/tools.ts:81-99 (registration)Registration of the 'get_teams' tool as a Tool object. Contains the name 'get_teams', a detailed description explaining how to list/search FRC teams with optional filters, annotations marking it as read-only/idempotent, and the inputSchema derived from GetTeamsInputSchema.
{ name: 'get_teams', description: 'List FIRST Robotics Competition (FRC) teams from the Statbotics database with optional filters. ' + 'Returns an array of team profiles (number, name, location, rookie year, active flag, career EPA stats, ' + 'career win rate). ' + 'Filter by `country` (e.g. "USA", "Canada"), `state` (two-letter code, e.g. "NC", "CA"), ' + '`district` (one of ca, fch, fim, fin, fit, fma, fnc, fsc, isr, ne, ont, pch, pnw, win), ' + 'and `active` (true to limit to teams that competed in the last year). ' + 'Sort with `metric`/`ascending` (e.g. metric="norm_epa", ascending=false to find the strongest active teams) ' + 'and paginate with `limit`/`offset`. ' + 'Use this to answer "which teams in Texas are most successful?", "list all teams in the FIM district", ' + 'or "find the top 50 teams by normalized EPA".', annotations: { title: 'List/Search FRC Teams', ...readOnlyAnnotations, }, inputSchema: toMCPSchema(GetTeamsInputSchema), },