get_sports_teams
Retrieve a list of teams for a specified sport on Polymarket to analyze prediction markets and monitor events.
Instructions
List teams for a given sport on Polymarket.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sport | No | Sport code (e.g. 'nba', 'nfl', 'epl') |
Implementation Reference
- src/tools/gamma/sports.ts:23-40 (handler)The tool definition and handler for "get_sports_teams" which invokes the GammaApi service.
server.tool( "get_sports_teams", "List teams for a given sport on Polymarket.", { sport: z.string().optional().describe("Sport code (e.g. 'nba', 'nfl', 'epl')"), }, async (args) => { try { const data = await gamma.getSportsTeams(args.sport); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${(error as Error).message}` }], isError: true, }; } }, ); - src/api/gamma.ts:146-150 (handler)The actual implementation of the "getSportsTeams" logic that fetches data from the API client.
async getSportsTeams(sport?: string): Promise<GammaSportsTeam[]> { const query: Record<string, string | undefined> = {}; if (sport) query.sport = sport; return this.client.gamma<GammaSportsTeam[]>("/sports/teams", query, CACHE_TTLS.sports); }