Skip to main content
Glama

get_event_district_points

Retrieve district points for FIRST Robotics Competition teams at a specific event to track team rankings and qualification progress.

Instructions

Get district points for teams at an event

Input Schema

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

Implementation Reference

  • The handler logic within the main handleToolCall switch statement. Validates input event_key, fetches district points data from The Blue Alliance API endpoint `/event/{event_key}/district_points`, parses the response using DistrictPointsSchema, and returns the JSON stringified data.
    case 'get_event_district_points': {
      const { event_key } = z.object({ event_key: EventKeySchema }).parse(args);
      const data = await makeApiRequest(`/event/${event_key}/district_points`);
      const districtPoints = DistrictPointsSchema.parse(data);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(districtPoints, null, 2),
          },
        ],
      };
    }
  • src/tools.ts:182-195 (registration)
    The tool registration entry in the exported tools array, defining the tool name, description, and JSON input schema for MCP.
    {
      name: 'get_event_district_points',
      description: 'Get district points for teams at an event',
      inputSchema: {
        type: 'object',
        properties: {
          event_key: {
            type: 'string',
            description: 'Event key (e.g., 2023casj)',
          },
        },
        required: ['event_key'],
      },
    },
  • Zod schema used for validating and parsing the output from the TBA district_points API endpoint.
    export const DistrictPointsSchema = z.object({
      points: z.record(
        z.string(),
        z.object({
          alliance_points: z.number(),
          award_points: z.number(),
          elim_points: z.number(),
          qual_points: z.number(),
          total: z.number(),
        }),
      ),
      tiebreakers: z
        .record(
          z.string(),
          z.object({
            highest_qual_scores: z.array(z.number()).nullish(),
            qual_wins: z.number().nullish(),
          }),
        )
        .nullish(),
    });
  • Zod schema used for input validation of the event_key parameter in the 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