Skip to main content
Glama

get_event_alliances

Retrieve elimination alliance information for FIRST Robotics Competition events to analyze team partnerships and playoff structures.

Instructions

Get elimination alliances for a specific event

Input Schema

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

Implementation Reference

  • Handler function for the 'get_event_alliances' tool. Parses event_key argument, fetches alliances data from The Blue Alliance API, validates with Zod schema, and returns JSON stringified response.
    case 'get_event_alliances': {
      const { event_key } = z.object({ event_key: EventKeySchema }).parse(args);
      const data = await makeApiRequest(`/event/${event_key}/alliances`);
      const alliances = z.array(AllianceSchema).parse(data);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(alliances, null, 2),
          },
        ],
      };
    }
  • src/tools.ts:154-167 (registration)
    Tool registration object defining name, description, and input schema for 'get_event_alliances' in the exported tools array used by the MCP server.
    {
      name: 'get_event_alliances',
      description: 'Get elimination alliances for a specific event',
      inputSchema: {
        type: 'object',
        properties: {
          event_key: {
            type: 'string',
            description: 'Event key (e.g., 2023casj)',
          },
        },
        required: ['event_key'],
      },
    },
  • Zod schema (AllianceSchema) for validating the API response data of event alliances, used in the tool handler.
    export const AllianceSchema = z.object({
      name: z.string().nullish(),
      backup: z
        .object({
          in: z.string().nullish(),
          out: z.string().nullish(),
        })
        .nullish(),
      declines: z.array(z.string()).nullish(),
      picks: z.array(z.string()),
      status: z
        .object({
          current_level_record: z
            .object({
              losses: z.number(),
              ties: z.number(),
              wins: z.number(),
            })
            .nullish(),
          level: z.string().nullish(),
          playoff_average: z.number().nullish(),
          record: z
            .object({
              losses: z.number(),
              ties: z.number(),
              wins: z.number(),
            })
            .nullish(),
          status: z.string().nullish(),
        })
        .nullish(),
    });
  • Zod schema (EventKeySchema) for input validation of event_key parameter, used in the tool handler.
    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