Skip to main content
Glama

get_events_simple

Retrieve a simplified list of FIRST Robotics Competition events for a specific year using The Blue Alliance API.

Instructions

Get simplified list of events for a year

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesCompetition year

Implementation Reference

  • Handler function that validates the input year using YearSchema, fetches simplified events data from the TBA API endpoint `/events/${year}/simple`, parses the response as an array of EventSimpleSchema objects, and returns the JSON-formatted events list.
    case 'get_events_simple': {
      const { year } = z.object({ year: YearSchema }).parse(args);
      const data = await makeApiRequest(`/events/${year}/simple`);
      const events = z.array(EventSimpleSchema).parse(data);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(events, null, 2),
          },
        ],
      };
    }
  • Zod schema definition for EventSimple used to validate the output data from the TBA API simple events endpoint.
    export const EventSimpleSchema = z.object({
      key: z.string(),
      name: z.string(),
      event_code: z.string(),
      event_type: z.number(),
      city: z.string().nullish(),
      state_prov: z.string().nullish(),
      country: z.string().nullish(),
      start_date: z.string(),
      end_date: z.string(),
      year: z.number(),
    });
  • src/tools.ts:547-562 (registration)
    Tool registration object defining the name, description, and input schema for get_events_simple, which requires a year parameter.
    {
      name: 'get_events_simple',
      description: 'Get simplified list of events for a year',
      inputSchema: {
        type: 'object',
        properties: {
          year: {
            type: 'number',
            description: 'Competition year',
            minimum: 1992,
            maximum: new Date().getFullYear() + 1,
          },
        },
        required: ['year'],
      },
    },
  • Zod schema for validating the year input parameter used in the handler and matching the tool's input schema constraints.
    export const YearSchema = z
      .number()
      .int()
      .min(1992)
      .max(new Date().getFullYear() + 1);

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