get_teams
Retrieve paginated lists of FIRST Robotics Competition teams from The Blue Alliance API to access comprehensive team data.
Instructions
Get list of teams with pagination
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_num | Yes | Page number (0-indexed) |
Implementation Reference
- src/handlers.ts:303-317 (handler)The handler logic for the 'get_teams' tool. It validates the input page_num, fetches paginated teams from the TBA API endpoint `/teams/${page_num}`, parses the response using TeamSchema, and returns the JSON-stringified list of teams.case 'get_teams': { const { page_num } = z .object({ page_num: z.number().min(0) }) .parse(args); const data = await makeApiRequest(`/teams/${page_num}`); const teams = z.array(TeamSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(teams, null, 2), }, ], }; }
- src/tools.ts:281-295 (schema)The tool definition including name, description, and input schema for 'get_teams'. This is part of the tools array registered with the MCP server.{ name: 'get_teams', description: 'Get list of teams with pagination', inputSchema: { type: 'object', properties: { page_num: { type: 'number', description: 'Page number (0-indexed)', minimum: 0, }, }, required: ['page_num'], }, },
- src/index.ts:45-47 (registration)Registration of all tools with the MCP server via ListToolsRequestSchema handler, which returns the tools array including 'get_teams'.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/schemas.ts:17-17 (schema)Definition of TeamSchema used for output validation in the get_teams handler. (Note: full schema spans multiple lines.)export const TeamSchema = z.object({