get_team_robots
Retrieve robot names for a specific FIRST Robotics Competition team by year using The Blue Alliance API.
Instructions
Get robot names for a team by year
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team_key | Yes | Team key in format frcXXXX (e.g., frc86) |
Implementation Reference
- src/handlers.ts:249-261 (handler)Handler logic for the 'get_team_robots' tool. Validates the team_key input using TeamKeySchema, fetches robot data from the TBA API endpoint `/team/{team_key}/robots`, parses the response as an array of RobotSchema objects, and returns the JSON stringified data.case 'get_team_robots': { const { team_key } = z.object({ team_key: TeamKeySchema }).parse(args); const data = await makeApiRequest(`/team/${team_key}/robots`); const robots = z.array(RobotSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(robots, null, 2), }, ], }; }
- src/tools.ts:227-240 (registration)Tool registration in the MCP tools array, including name, description, and input schema for 'get_team_robots'.name: 'get_team_robots', description: 'Get robot names for a team by year', 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:242-247 (schema)Zod schema definition for Robot objects returned by the TBA /team/{team_key}/robots API endpoint.export const RobotSchema = z.object({ year: z.number(), robot_name: z.string(), key: z.string(), team_key: z.string(), });
- src/schemas.ts:4-6 (schema)Zod schema for validating team_key input parameter (format frcXXXX).export const TeamKeySchema = z .string() .regex(/^frc\d+$/, 'Team key must be in format frcXXXX');
- src/index.ts:45-47 (registration)MCP server registration of the listTools handler which returns the full tools array including 'get_team_robots'.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });