get_team_match
Retrieve a team's contribution to a specific FRC match, including alliance, EPA, predicted score components, and outcome flags. Ideal for scouting and post-match analysis.
Instructions
Get a single team's contribution to a single FIRST Robotics Competition (FRC) match - the per-robot view of one match. Returns which alliance the team was on (red/blue), the team's EPA going into the match, the team's predicted score contribution by component, and post-match outcome flags. Useful for scouting and post-match analysis: "how much did team 2056 contribute to alliance score in 2024onham_sf2m1?". Requires both team (integer, no prefix) and match (match key like "2024flor_qm20"). For listing many team-match rows, use get_team_matches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| team | Yes | Team number (no prefix), e.g. 86 | |
| match | Yes | Match key, e.g. 2024flor_qm20 |
Implementation Reference
- src/handlers.ts:247-253 (handler)Handler for get_team_match: parses team and match from args, calls Statbotics API endpoint /v3/team_match/{team}/{match}, and returns the JSON response.
case 'get_team_match': { const { team, match } = GetTeamMatchInputSchema.parse(args); const data = await makeApiRequest(`/v3/team_match/${team}/${match}`); return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }], }; } - src/schemas.ts:185-188 (schema)Input schema for get_team_match: requires 'team' (integer, min 1) and 'match' (string match key).
export const GetTeamMatchInputSchema = z.object({ team: TeamNumberSchema, match: MatchKeySchema, }); - src/tools.ts:241-257 (registration)Registration of get_team_match tool in the tools array with description, read-only annotations, and input schema.
{ name: 'get_team_match', description: "Get a single team's contribution to a single FIRST Robotics Competition (FRC) match - the per-robot " + 'view of one match. ' + "Returns which alliance the team was on (red/blue), the team's EPA going into the match, the team's " + 'predicted score contribution by component, and post-match outcome flags. ' + 'Useful for scouting and post-match analysis: "how much did team 2056 contribute to alliance score in ' + '2024onham_sf2m1?". ' + 'Requires both `team` (integer, no prefix) and `match` (match key like "2024flor_qm20"). ' + 'For listing many team-match rows, use get_team_matches.', annotations: { title: 'Get FRC Team Contribution in Match (Single Team-Match)', ...readOnlyAnnotations, }, inputSchema: toMCPSchema(GetTeamMatchInputSchema), }, - src/utils.ts:23-50 (helper)Helper function makeApiRequest used by the handler to make HTTP GET requests to the Statbotics API.
export async function makeApiRequest(endpoint: string): Promise<unknown> { try { const url = `https://api.statbotics.io${endpoint}`; const response = await fetch(url, { headers: { Accept: 'application/json', }, }); if (!response.ok) { const errorMessage = `Statbotics API request failed: ${response.status} ${response.statusText} for endpoint ${endpoint}`; await log('error', errorMessage); throw new Error(errorMessage); } return response.json(); } catch (error) { if (error instanceof Error) { const errorMessage = `API request error for endpoint ${endpoint}: ${error.message}`; await log('error', errorMessage); throw error; } const errorMessage = `Unknown error during API request for endpoint ${endpoint}`; await log('error', `${errorMessage}: ${error}`); throw new Error(errorMessage); } }