Skip to main content
Glama

get_event_matches_simple

Retrieve simplified match data for FIRST Robotics Competition events to analyze team performance and event outcomes.

Instructions

Get simplified matches for an event

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_keyYesEvent key (e.g., 2023casj)

Implementation Reference

  • The core handler logic for the 'get_event_matches_simple' tool. It validates the input event_key using EventKeySchema, fetches simplified match data from the TBA API endpoint `/event/{event_key}/matches/simple`, parses the response using an array of MatchSimpleSchema, and returns the matches as a formatted JSON text response.
    case 'get_event_matches_simple': {
      const { event_key } = z.object({ event_key: EventKeySchema }).parse(args);
      const data = await makeApiRequest(`/event/${event_key}/matches/simple`);
      const matches = z.array(MatchSimpleSchema).parse(data);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(matches, null, 2),
          },
        ],
      };
    }
  • src/tools.ts:784-796 (registration)
    Tool registration in the exported tools array used by the MCP server. Defines the tool name, description, and input schema for validation by the MCP framework.
      name: 'get_event_matches_simple',
      description: 'Get simplified matches for an event',
      inputSchema: {
        type: 'object',
        properties: {
          event_key: {
            type: 'string',
            description: 'Event key (e.g., 2023casj)',
          },
        },
        required: ['event_key'],
      },
    },
  • Zod schema definition for MatchSimple objects, used to validate the array of matches returned from the TBA API in the handler.
    export const MatchSimpleSchema = z.object({
      key: z.string(),
      comp_level: z.string(),
      set_number: z.number(),
      match_number: z.number(),
      alliances: z.object({
        red: z.object({
          score: z.number(),
          team_keys: z.array(z.string()),
        }),
        blue: z.object({
          score: z.number(),
          team_keys: z.array(z.string()),
        }),
      }),
      winning_alliance: z.string().nullish(),
      event_key: z.string(),
      time: z.number().nullish(),
      predicted_time: z.number().nullish(),
      actual_time: z.number().nullish(),
    });
  • Zod schema for event_key input validation, used in the handler to parse tool arguments.
    export const EventKeySchema = z.string();

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