get_team_districts
Get district affiliations an FRC team has held over the years, showing year, district key, and name.
Instructions
List the FRC district affiliations a team has held across its history. Returns district records (abbreviation, display name, district key, year). Useful for tracking when a team participated in district play (FIRST in Michigan, New England, Chesapeake, Pacific Northwest, FIRST In Texas, etc.) versus open regional competition, and for analyzing a team's geographic competition history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team_key | Yes | FRC team key formatted as 'frc' followed by the team number with no leading zeros (e.g., 'frc86', 'frc254', 'frc1114'). Uniquely identifies a FIRST Robotics Competition team on The Blue Alliance. |
Implementation Reference
- src/handlers.ts:235-247 (handler)Case handler for 'get_team_districts' tool. Parses team_key from args, calls TBA API /team/{team_key}/districts, validates response with DistrictSchema array, and returns the district data as JSON.
case 'get_team_districts': { const { team_key } = z.object({ team_key: TeamKeySchema }).parse(args); const data = await makeApiRequest(`/team/${team_key}/districts`); const districts = z.array(DistrictSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(districts, null, 2), }, ], }; } - src/schemas.ts:565-567 (schema)Input schema for get_team_districts: requires team_key (string matching frcXXXX format).
export const GetTeamDistrictsInputSchema = z.object({ team_key: TeamKeySchema, }); - src/schemas.ts:285-290 (schema)DistrictSchema: defines the shape of a district object (abbreviation, display_name, key, year). Used both by get_team_districts and get_districts handlers.
export const DistrictSchema = z.object({ abbreviation: z.string(), display_name: z.string(), key: z.string(), year: z.number(), }); - src/tools.ts:172-177 (registration)Tool registration for 'get_team_districts' with description, inputSchema (GetTeamDistrictsInputSchema), and read-only annotations.
{ name: 'get_team_districts', description: "List the FRC district affiliations a team has held across its history. Returns district records (abbreviation, display name, district key, year). Useful for tracking when a team participated in district play (FIRST in Michigan, New England, Chesapeake, Pacific Northwest, FIRST In Texas, etc.) versus open regional competition, and for analyzing a team's geographic competition history.", inputSchema: toMCPSchema(GetTeamDistrictsInputSchema), annotations: { ...READ_ONLY_API, title: 'Get Team District History' },