Skip to main content
Glama

get_team_events

Retrieve FIRST Robotics Competition events for a specific team in a given year. Use this tool to access team participation history and event data from The Blue Alliance API.

Instructions

Get events that a team has participated in for a given year

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
team_keyYesTeam key in format frcXXXX (e.g., frc86)
yearYesCompetition year

Implementation Reference

  • The handler function for the 'get_team_events' tool. It validates the input arguments (team_key and year) using Zod schemas, makes an API request to The Blue Alliance (TBA) for the team's events in that year, parses the response as an array of EventSchema objects, and returns the JSON-formatted result.
    case 'get_team_events': { const { team_key, year } = z .object({ team_key: TeamKeySchema, year: YearSchema, }) .parse(args); const data = await makeApiRequest(`/team/${team_key}/events/${year}`); const events = z.array(EventSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(events, null, 2), }, ], }; }
  • The tool definition including the name 'get_team_events', description, and inputSchema specifying required parameters team_key (string matching frcXXXX pattern) and year (number between 1992 and current year +1). This is used for MCP tool listing and input validation.
    { name: 'get_team_events', description: 'Get events that a team has participated in for a given year', inputSchema: { type: 'object', properties: { team_key: { type: 'string', description: 'Team key in format frcXXXX (e.g., frc86)', pattern: '^frc\\d+$', }, year: { type: 'number', description: 'Competition year', minimum: 1992, maximum: new Date().getFullYear() + 1, }, }, required: ['team_key', 'year'], }, },
  • src/index.ts:45-47 (registration)
    Registers the handler for ListToolsRequest in the MCP server, which returns the array of all tools (imported from tools.ts), thereby registering 'get_team_events'.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
  • Zod schema definition for Event objects, used in the handler to parse and validate the API response as an array of events.
    export const EventSchema = z.object({ key: z.string(), name: z.string(), event_code: z.string(), event_type: z.number(), district: z .object({ abbreviation: z.string(), display_name: z.string(), key: z.string(), year: z.number(), }) .nullish(), city: z.string().nullish(), state_prov: z.string().nullish(), country: z.string().nullish(), start_date: z.string(), end_date: z.string(), year: z.number(), short_name: z.string().nullish(), event_type_string: z.string(), week: z.number().nullish(), address: z.string().nullish(), postal_code: z.string().nullish(), gmaps_place_id: z.string().nullish(), gmaps_url: z.string().nullish(), lat: z.number().nullish(), lng: z.number().nullish(), location_name: z.string().nullish(), timezone: z.string().nullish(), website: z.string().nullish(), first_event_id: z.string().nullish(), first_event_code: z.string().nullish(), webcasts: z .array( z.object({ type: z.string(), channel: z.string(), date: z.string().nullish(), file: z.string().nullish(), }), ) .nullish(), division_keys: z.array(z.string()).nullish(), parent_event_key: z.string().nullish(), playoff_type: z.number().nullish(), playoff_type_string: z.string().nullish(), });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/withinfocus/tba'

If you have feedback or need assistance with the MCP directory API, please join our Discord server