get_event_oprs
Retrieve team performance ratings (OPR, DPR, CCWM) for a specific FIRST Robotics Competition event to analyze competitive data.
Instructions
Get OPR, DPR, and CCWM ratings for teams at an event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_key | Yes | Event key (e.g., 2023casj) |
Implementation Reference
- src/handlers.ts:346-358 (handler)Handler implementation for the 'get_event_oprs' tool. Parses input arguments using Zod schema, fetches OPR/DPR/CCWM data from The Blue Alliance API endpoint `/event/{event_key}/oprs`, validates response with EventOPRsSchema, and returns formatted text content with JSON string.case 'get_event_oprs': { const { event_key } = z.object({ event_key: EventKeySchema }).parse(args); const data = await makeApiRequest(`/event/${event_key}/oprs`); const oprs = EventOPRsSchema.parse(data); return { content: [ { type: 'text', text: JSON.stringify(oprs, null, 2), }, ], }; }
- src/tools.ts:318-331 (registration)Tool registration definition in the tools array exported for MCP list_tools handler. Includes name, description, and JSON input schema for event_key parameter.{ name: 'get_event_oprs', description: 'Get OPR, DPR, and CCWM ratings for teams at an event', inputSchema: { type: 'object', properties: { event_key: { type: 'string', description: 'Event key (e.g., 2023casj)', }, }, required: ['event_key'], }, },
- src/schemas.ts:272-276 (schema)Zod schema used in the handler for output validation of the TBA API response containing OPRs, DPRs, and CCWM values for teams at the event.export const EventOPRsSchema = z.object({ oprs: z.record(z.string(), z.number()), dprs: z.record(z.string(), z.number()), ccwms: z.record(z.string(), z.number()), });
- src/schemas.ts:8-8 (schema)Zod schema for validating the event_key input parameter used in the handler.export const EventKeySchema = z.string();