get_team_districts
Retrieve district history for FIRST Robotics Competition teams to track their regional participation and competitive progression over time.
Instructions
Get district history for a team
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team_key | Yes | Team key in format frcXXXX (e.g., frc86) |
Implementation Reference
- src/handlers.ts:235-247 (handler)Executes the get_team_districts tool: validates team_key input, fetches district data from TBA API, parses with DistrictSchema array, returns JSON string.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/tools.ts:211-225 (registration)Registers the get_team_districts tool in the tools array with name, description, and input schema definition.{ name: 'get_team_districts', description: 'Get district history for a team', inputSchema: { type: 'object', properties: { team_key: { type: 'string', description: 'Team key in format frcXXXX (e.g., frc86)', pattern: '^frc\\d+$', }, }, required: ['team_key'], }, },
- src/schemas.ts:249-254 (schema)Zod schema definition for District objects used to validate the tool's output data.export const DistrictSchema = z.object({ abbreviation: z.string(), display_name: z.string(), key: z.string(), year: z.number(), });
- src/schemas.ts:4-6 (schema)Zod schema for team_key input parameter used in the tool handler for validation.export const TeamKeySchema = z .string() .regex(/^frc\d+$/, 'Team key must be in format frcXXXX');