Skip to main content
Glama

get_teams_keys

Read-onlyIdempotent

Retrieve a paginated list of FRC team keys ('frc86') to build team indices or drive subsequent queries with minimal payload size.

Instructions

Paginated listing of every registered FRC team key only (strings like 'frc86'). Lightest team enumeration option; ideal for building team-key indices or driving subsequent per-team queries with minimal payload size.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_numYesZero-indexed page number for paginated team listings. TBA returns up to 500 teams per page; increment until the response is empty to enumerate all teams.

Implementation Reference

  • Handler function that executes the get_teams_keys tool logic. Parses page_num from args, makes API request to /teams/{page_num}/keys, validates response as an array of strings, and returns the keys.
    case 'get_teams_keys': {
      const { page_num } = z
        .object({ page_num: z.number().min(0) })
        .parse(args);
      const data = await makeApiRequest(`/teams/${page_num}/keys`);
      const keys = z.array(z.string()).parse(data);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(keys, null, 2),
          },
        ],
      };
    }
  • Input schema for get_teams_keys tool, containing a single page_num field validated against PageNumSchema.
    export const GetTeamsKeysInputSchema = z.object({
      page_num: PageNumSchema,
    });
  • src/tools.ts:277-283 (registration)
    Registration of the get_teams_keys tool with its name, description, input schema using toMCPSchema, and READ_ONLY_API annotations.
    {
      name: 'get_teams_keys',
      description:
        "Paginated listing of every registered FRC team key only (strings like 'frc86'). Lightest team enumeration option; ideal for building team-key indices or driving subsequent per-team queries with minimal payload size.",
      inputSchema: toMCPSchema(GetTeamsKeysInputSchema),
      annotations: { ...READ_ONLY_API, title: 'List All FRC Team Keys' },
    },
  • The makeApiRequest helper function that performs the actual HTTP request to The Blue Alliance API, used by the handler.
    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);
      }
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, non-destructive, idempotent. The description adds that it is paginated with up to 500 teams per page and to increment page_num until empty. This provides useful behavioral context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, each serving a distinct purpose: stating what the tool does and when to use it. No filler words; front-loaded with the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, but description explains return type (strings like 'frc86') and that it's a list. Covers pagination behavior and use case. For a simple one-parameter tool, this is complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides a thorough description of 'page_num' (zero-indexed, 500 per page, increment until empty). The description adds little extra meaning, just calling it 'lightest'. With 100% schema coverage, baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists all registered FRC team keys only, paginated. It uses specific language ('Paginated listing of every registered FRC team key only') and distinguishes itself from siblings that return full team objects or simple team info, as seen in the sibling list.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly calls it the 'lightest team enumeration option' and suggests using it for building indices or driving per-team queries. This guides when to use it, though it doesn't explicitly mention when not to use it or name alternatives beyond implication.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server