Skip to main content
Glama

get_event_rankings

Retrieve team rankings for FIRST Robotics Competition events to analyze performance and standings. Use event keys to access specific competition data.

Instructions

Get team rankings for a specific event

Input Schema

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

Implementation Reference

  • Handler function for 'get_event_rankings' tool: validates event_key input, fetches rankings from TBA API endpoint `/event/{event_key}/rankings`, parses with RankingSchema, and returns JSON-formatted response.
    case 'get_event_rankings': { const { event_key } = z.object({ event_key: EventKeySchema }).parse(args); const data = await makeApiRequest(`/event/${event_key}/rankings`); const rankings = RankingSchema.parse(data); return { content: [ { type: 'text', text: JSON.stringify(rankings, null, 2), }, ], }; }
  • src/tools.ts:126-139 (registration)
    Tool registration in the tools array exported from tools.ts, including name, description, and input schema definition for MCP tool listing.
    { name: 'get_event_rankings', description: 'Get team rankings for a specific event', inputSchema: { type: 'object', properties: { event_key: { type: 'string', description: 'Event key (e.g., 2023casj)', }, }, required: ['event_key'], }, },
  • Zod schema definition for parsing the TBA event rankings API response, used in the handler for output validation.
    export const RankingSchema = z.object({ rankings: z.array( z.object({ team_key: z.string(), rank: z.number(), dq: z.number().nullish(), matches_played: z.number(), qual_average: z.number().nullish(), record: z .object({ losses: z.number(), wins: z.number(), ties: z.number(), }) .nullish(), extra_stats: z.array(z.number()).nullish(), sort_orders: z.array(z.number()).nullish(), }), ), extra_stats_info: z .array( z.object({ name: z.string(), precision: z.number(), }), ) .nullish(), sort_order_info: z .array( z.object({ name: z.string(), precision: z.number(), }), ) .nullish(), });
  • Zod schema for event key input validation, used 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