Skip to main content
Glama

get_team_matches_simple

Retrieve simplified match data for a specific FIRST Robotics Competition team in a given year using The Blue Alliance API.

Instructions

Get simplified matches for a team in a specific year

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
team_keyYesTeam key in format frcXXXX (e.g., frc86)
yearYesCompetition year

Implementation Reference

  • The handler case in handleToolCall that validates input parameters (team_key and year), fetches simplified match data for the team in the specified year from the TBA API using makeApiRequest, parses the response with Zod's array of MatchSimpleSchema, and returns the JSON stringified data.
    case 'get_team_matches_simple': { const { team_key, year } = z .object({ team_key: TeamKeySchema, year: YearSchema, }) .parse(args); const data = await makeApiRequest( `/team/${team_key}/matches/${year}/simple`, ); const matches = z.array(MatchSimpleSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(matches, null, 2), }, ], }; }
  • src/tools.ts:654-674 (registration)
    Tool registration object in the exported tools array, defining the name, description, and JSON input schema for MCP tool listing.
    { name: 'get_team_matches_simple', description: 'Get simplified matches for a team in a specific year', inputSchema: { type: 'object', properties: { team_key: { type: 'string', description: 'Team key in format frcXXXX (e.g., frc86)', pattern: '^frc\\d+$', }, year: { type: 'number', description: 'Competition year', minimum: 1992, maximum: new Date().getFullYear() + 1, }, }, required: ['team_key', 'year'], }, },
  • Zod schema definition for a simple match object, used to validate the API response data 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 validating team_key input parameter.
    export const TeamKeySchema = z .string() .regex(/^frc\d+$/, 'Team key must be in format frcXXXX');
  • Zod schema for validating year input parameter.
    export const YearSchema = z .number() .int() .min(1992) .max(new Date().getFullYear() + 1);

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