get_district_teams_keys
Retrieve team keys for FIRST Robotics Competition teams within a specified district using The Blue Alliance API. Input a district key to access organized team identifiers.
Instructions
Get team keys 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:993-1007 (handler)The handler function for the 'get_district_teams_keys' tool. It parses the input district_key, makes an API request to The Blue Alliance for district team keys, validates the response as an array of strings, and returns the JSON-formatted list.case 'get_district_teams_keys': { const { district_key } = z .object({ district_key: z.string() }) .parse(args); const data = await makeApiRequest(`/district/${district_key}/teams/keys`); const keys = z.array(z.string()).parse(data); return { content: [ { type: 'text', text: JSON.stringify(keys, null, 2), }, ], }; }
- src/tools.ts:983-997 (registration)The tool registration in the MCP tools array, defining the name, description, and input schema requiring a 'district_key' string parameter.{ name: 'get_district_teams_keys', description: 'Get team keys in a specific district', inputSchema: { type: 'object', properties: { district_key: { type: 'string', description: 'District key (e.g., 2023fim)', }, }, required: ['district_key'], }, }, ];
- src/handlers.ts:994-1006 (schema)Inline Zod schema validation for input parameters (district_key: string) and output (array of strings). Note: Input schema also mirrored in tools.ts for MCP.const { district_key } = z .object({ district_key: z.string() }) .parse(args); const data = await makeApiRequest(`/district/${district_key}/teams/keys`); const keys = z.array(z.string()).parse(data); return { content: [ { type: 'text', text: JSON.stringify(keys, null, 2), }, ], };