get_series
Retrieve grouped collections of related prediction market events from Polymarket. Use this tool to browse event series with pagination controls for limit and offset.
Instructions
List Polymarket event series (grouped collections of related events).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of results | |
| offset | No | Pagination offset |
Implementation Reference
- src/tools/gamma/series.ts:13-23 (handler)The handler for the "get_series" tool, which invokes the Gamma API to list event series.
async (args) => { try { const data = await gamma.getSeries(args); 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/tools/gamma/series.ts:6-12 (registration)Registration and schema definition for the "get_series" tool.
server.tool( "get_series", "List Polymarket event series (grouped collections of related events).", { limit: z.number().min(1).max(100).default(20).describe("Number of results"), offset: z.number().min(0).default(0).describe("Pagination offset"), }, - src/api/gamma.ts:128-136 (helper)The API client method that performs the actual network request for getting series.
async getSeries(params?: { limit?: number; offset?: number; }): Promise<GammaSeries[]> { const query: Record<string, string | undefined> = {}; if (params?.limit !== undefined) query.limit = String(params.limit); if (params?.offset !== undefined) query.offset = String(params.offset); return this.client.gamma<GammaSeries[]>("/series", query); }