propline_list_events
Retrieve upcoming sports events with IDs, teams, and start times. Use event IDs to access odds, props, and results.
Instructions
List upcoming events for a sport. Returns each event's id, home_team, away_team, commence_time. Use the returned event_id to drill into per-event odds, props, +EV, or results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sport_key | Yes | Sport key from propline_list_sports — e.g. baseball_mlb, basketball_nba | |
| live | No | If true, only return in-progress (live) events. Defaults to false. |
Implementation Reference
- src/index.ts:82-109 (registration)Tool registration for 'propline_list_events' within the tools array, including name, description, input schema, and handler that delegates to client().listEvents().
{ name: "propline_list_events", description: "List upcoming events for a sport. Returns each event's id, " + "home_team, away_team, commence_time. Use the returned event_id " + "to drill into per-event odds, props, +EV, or results.", inputSchema: { type: "object", properties: { sport_key: { type: "string", description: "Sport key from propline_list_sports — e.g. baseball_mlb, basketball_nba", }, live: { type: "boolean", description: "If true, only return in-progress (live) events. Defaults to false.", }, }, required: ["sport_key"], additionalProperties: false, }, handler: (args) => client().listEvents(args.sport_key as string, { live: args.live as boolean | undefined, }), }, - src/index.ts:105-108 (handler)Inline handler for propline_list_events — extracts sport_key and optional live flag and calls client().listEvents().
handler: (args) => client().listEvents(args.sport_key as string, { live: args.live as boolean | undefined, }), - src/index.ts:88-104 (schema)Input schema: requires sport_key (string), optional live (boolean), no additional properties.
inputSchema: { type: "object", properties: { sport_key: { type: "string", description: "Sport key from propline_list_sports — e.g. baseball_mlb, basketball_nba", }, live: { type: "boolean", description: "If true, only return in-progress (live) events. Defaults to false.", }, }, required: ["sport_key"], additionalProperties: false, }, - src/client.ts:81-85 (helper)PropLineClient.listEvents() — the actual API call that GETs /v1/sports/{sportKey}/events with an optional ?live=true query parameter.
listEvents(sportKey: string, opts: { live?: boolean } = {}): Promise<unknown> { return this.request(`/v1/sports/${sportKey}/events`, { live: opts.live ? "true" : undefined, }); } - src/client.ts:39-73 (helper)The private request() method that all client calls (including listEvents) use — constructs URL with query params, sends fetch with API key, parses response.
private async request<T = unknown>( path: string, query: Record<string, string | number | boolean | undefined> = {}, ): Promise<T> { const url = new URL(this.baseUrl + path); for (const [k, v] of Object.entries(query)) { if (v !== undefined && v !== null && v !== "") { url.searchParams.set(k, String(v)); } } const controller = new AbortController(); const timer = setTimeout(() => controller.abort(), this.timeoutMs); try { const r = await fetch(url, { headers: { "X-API-Key": this.apiKey, Accept: "application/json", "User-Agent": "propline-mcp/0.1.0", }, signal: controller.signal, }); const text = await r.text(); if (!r.ok) { throw new PropLineHTTPError(r.status, text); } try { return JSON.parse(text) as T; } catch { return text as unknown as T; } } finally { clearTimeout(timer); } }