Skip to main content
Glama

get_team_awards_all

Retrieve comprehensive award history for any FIRST Robotics Competition team across all competition years to analyze achievements and track performance.

Instructions

Get all awards won by a team across all years

Input Schema

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

Implementation Reference

  • Executes the tool logic: validates team_key input, makes API request to TBA for all awards of the team, parses response as array of awards, and returns formatted JSON text.
    case 'get_team_awards_all': {
      const { team_key } = z.object({ team_key: TeamKeySchema }).parse(args);
      const data = await makeApiRequest(`/team/${team_key}/awards`);
      const awards = z.array(AwardSchema).parse(data);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(awards, null, 2),
          },
        ],
      };
    }
  • src/tools.ts:346-359 (registration)
    Registers the tool in the MCP tools list with name, description, and input schema definition.
    {
      name: 'get_team_awards_all',
      description: 'Get all awards won by a team across all years',
      inputSchema: {
        type: 'object',
        properties: {
          team_key: {
            type: 'string',
            description: 'Team key in format frcXXXX (e.g., frc86)',
            pattern: '^frc\\d+$',
          },
        },
        required: ['team_key'],
      },
  • Zod schema for validating the structure of individual award objects returned from the TBA API.
    export const AwardSchema = z.object({
      name: z.string(),
      award_type: z.number(),
      event_key: z.string(),
      recipient_list: z.array(
        z.object({
          team_key: z.string().nullish(),
          awardee: z.string().nullish(),
        }),
      ),
      year: z.number(),
    });
  • Zod schema for validating the team_key input parameter.
    export const TeamKeySchema = z
      .string()
      .regex(/^frc\d+$/, 'Team key must be in format frcXXXX');
  • Utility function to make authenticated requests to the TBA API v3, used by all tool handlers including this one.
    export async function makeApiRequest(endpoint: string): Promise<unknown> {
      try {
        const apiKey = getApiKey();
        const url = `https://www.thebluealliance.com/api/v3${endpoint}`;
    
        const response = await fetch(url, {
          headers: {
            'X-TBA-Auth-Key': apiKey,
            Accept: 'application/json',
          },
        });
    
        if (!response.ok) {
          const errorMessage = `TBA 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);
      }
    }

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