get_series_by_id
Retrieve a specific Polymarket event series by ID to access all related prediction market events and their details.
Instructions
Get a specific Polymarket event series by ID, including all events in the series.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Series ID |
Implementation Reference
- src/api/gamma.ts:138-140 (handler)The implementation of the logic to fetch a series by ID from the API client.
async getSeriesById(id: string): Promise<GammaSeries> { return this.client.gamma<GammaSeries>(`/series/${id}`); } - src/tools/gamma/series.ts:26-43 (handler)The registration and tool handler function for "get_series_by_id" using the GammaApi service.
server.tool( "get_series_by_id", "Get a specific Polymarket event series by ID, including all events in the series.", { id: z.string().describe("Series ID"), }, async (args) => { try { const data = await gamma.getSeriesById(args.id); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${(error as Error).message}` }], isError: true, }; } }, );