Skip to main content
Glama

get_teams_by_year_keys

Retrieve team keys for FIRST Robotics Competition teams that participated in a specific year, using pagination to manage large datasets.

Instructions

Get team keys that competed in a specific year

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesCompetition year
page_numYesPage number (0-indexed)

Implementation Reference

  • The handler logic for the 'get_teams_by_year_keys' tool. It validates the input parameters (year and page_num) using Zod schemas, makes an API request to The Blue Alliance (TBA) for team keys in the specified year and page, parses the response as an array of strings, and returns the JSON-stringified list.
    case 'get_teams_by_year_keys': { const { year, page_num } = z .object({ year: YearSchema, page_num: z.number().min(0), }) .parse(args); const data = await makeApiRequest(`/teams/${year}/${page_num}/keys`); const keys = z.array(z.string()).parse(data); return { content: [ { type: 'text', text: JSON.stringify(keys, null, 2), }, ], }; }
  • The MCP tool schema definition for 'get_teams_by_year_keys', including the input schema with year (number, 1992+) and page_num (number >=0) parameters.
    { name: 'get_teams_by_year_keys', description: 'Get team keys that competed in a specific year', inputSchema: { type: 'object', properties: { year: { type: 'number', description: 'Competition year', minimum: 1992, maximum: new Date().getFullYear() + 1, }, page_num: { type: 'number', description: 'Page number (0-indexed)', minimum: 0, }, }, required: ['year', 'page_num'], }, },
  • src/index.ts:45-47 (registration)
    Registration of all tools (including 'get_teams_by_year_keys') with the MCP server via the exported 'tools' array from tools.ts in the ListToolsRequest handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
  • src/index.ts:54-54 (registration)
    The CallToolRequest handler dispatches to handleToolCall based on tool name, which contains the case for 'get_teams_by_year_keys'.
    return await handleToolCall(name, args);

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