Skip to main content
Glama

get_district_teams_keys

Retrieve team keys for FIRST Robotics Competition teams within a specified district using The Blue Alliance API. Input a district key to access organized team identifiers.

Instructions

Get team keys in a specific district

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
district_keyYesDistrict key (e.g., 2023fim)

Implementation Reference

  • The handler function for the 'get_district_teams_keys' tool. It parses the input district_key, makes an API request to The Blue Alliance for district team keys, validates the response as an array of strings, and returns the JSON-formatted list.
    case 'get_district_teams_keys': {
      const { district_key } = z
        .object({ district_key: z.string() })
        .parse(args);
      const data = await makeApiRequest(`/district/${district_key}/teams/keys`);
      const keys = z.array(z.string()).parse(data);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(keys, null, 2),
          },
        ],
      };
    }
  • src/tools.ts:983-997 (registration)
    The tool registration in the MCP tools array, defining the name, description, and input schema requiring a 'district_key' string parameter.
      {
        name: 'get_district_teams_keys',
        description: 'Get team keys in a specific district',
        inputSchema: {
          type: 'object',
          properties: {
            district_key: {
              type: 'string',
              description: 'District key (e.g., 2023fim)',
            },
          },
          required: ['district_key'],
        },
      },
    ];
  • Inline Zod schema validation for input parameters (district_key: string) and output (array of strings). Note: Input schema also mirrored in tools.ts for MCP.
    const { district_key } = z
      .object({ district_key: z.string() })
      .parse(args);
    const data = await makeApiRequest(`/district/${district_key}/teams/keys`);
    const keys = z.array(z.string()).parse(data);
    return {
      content: [
        {
          type: 'text',
          text: JSON.stringify(keys, null, 2),
        },
      ],
    };

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