get_district_teams_simple
Retrieve simplified team information for a specific FIRST Robotics Competition district using The Blue Alliance API.
Instructions
Get simplified teams in a specific district
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| district_key | Yes | District key (e.g., 2023fim) |
Implementation Reference
- src/handlers.ts:975-991 (handler)Handler implementation in the handleToolCall switch statement. Validates district_key input, fetches simplified team list from TBA API endpoint `/district/{district_key}/teams/simple`, parses response as array of TeamSimpleSchema, and returns JSON string.case 'get_district_teams_simple': { const { district_key } = z .object({ district_key: z.string() }) .parse(args); const data = await makeApiRequest( `/district/${district_key}/teams/simple`, ); const teams = z.array(TeamSimpleSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(teams, null, 2), }, ], }; }
- src/tools.ts:969-982 (registration)Tool registration in the tools array exported for MCP server, including name, description, and input schema definition.{ name: 'get_district_teams_simple', description: 'Get simplified teams in a specific district', inputSchema: { type: 'object', properties: { district_key: { type: 'string', description: 'District key (e.g., 2023fim)', }, }, required: ['district_key'], }, },
- src/schemas.ts:369-377 (schema)Zod schema definition for TeamSimple used to parse the API response in the handler (array of this schema). Defines the structure of simplified team objects.export const TeamSimpleSchema = z.object({ key: z.string(), team_number: z.number(), nickname: z.string().nullish(), name: z.string(), city: z.string().nullish(), state_prov: z.string().nullish(), country: z.string().nullish(), });