Skip to main content
Glama

get_district_rankings

Retrieve team rankings for a specific FIRST Robotics Competition district to analyze competitive standings and performance metrics.

Instructions

Get team rankings within a district

Input Schema

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

Implementation Reference

  • The main handler logic for the 'get_district_rankings' tool. It validates the input district_key, fetches rankings from the TBA API endpoint `/district/${district_key}/rankings`, parses the response using DistrictRankingSchema array, and returns the JSON stringified data.
    case 'get_district_rankings': { const { district_key } = z .object({ district_key: z.string() }) .parse(args); const data = await makeApiRequest(`/district/${district_key}/rankings`); const rankings = z.array(DistrictRankingSchema).parse(data); return { content: [ { type: 'text', text: JSON.stringify(rankings, null, 2), }, ], }; }
  • src/tools.ts:411-424 (registration)
    Tool registration in the exported tools array, defining the name, description, and input schema for MCP tool discovery.
    { name: 'get_district_rankings', description: 'Get team rankings within a district', inputSchema: { type: 'object', properties: { district_key: { type: 'string', description: 'District key (e.g., 2023fim)', }, }, required: ['district_key'], }, },
  • Zod schema definition for individual district ranking objects, used to parse the API response array in the handler.
    export const DistrictRankingSchema = z.object({ team_key: z.string(), rank: z.number(), rookie_bonus: z.number().nullish(), point_total: z.number(), event_points: z.array( z.object({ district_cmp: z.boolean(), total: z.number(), alliance_points: z.number(), elim_points: z.number(), award_points: z.number(), event_key: z.string(), qual_points: z.number(), }), ), });

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